So I am trying to learn python at the moment. I'm a beginner programmer with only experience in limited web design and CMS administration.
I decided to create a simple little program that asked the user for the car number of a NASCAR team. Each team had a set of variables associated with it. So far, I did #1 and #2 and wanted to test the action of the code before completing the rest.
I ran into a problem where I believe I must be thinking about it wrong or maybe I am missing the knowledge because I just started learning to code in language.
Basically, it asks them for a car number and when they put it in, it display "driver(car number)" so if I input "2", it displays "driver2". But I want it to call the other variable driver2 instead which would display "Brad Keselowski" if correctly done.
Here's my code:
# NASCAR Numbers
# Display Driver Information Based on your Car Number Input
print("\t\t\tWelcome to NASCAR Numbers!")
print("\t\t Match Car Numbers to the Driver Names.")
input("\nPress the Enter Key to Play")
# 1 - Jamie McMurray
carnumber1 = ("1")
driver1 = ("Jamie McMurray")
make1 = ("Chevrolet")
sponsor1 = ("Bass Pro Shops/Allstate")
# 2 - Brad Keselowski
carnumber2 = ("2")
driver2 = ("Brad Keselowski")
make2 = ("Dodge")
sponsor2 = ("Miller Lite")
inputnumber = input("\nWhat car number do you want to lookup?\n\nCar Number:\t#")
driver = "driver"
print(driver + inputnumber)
Can anyone lead me in the right direction?