nstructions how do i create a program in python that : * Determine which vehicle a driver may want to buy. and that Use at least 4 constants like vehicles types like truck, SUV, toyota,range rover and ask the users name and age, and if the user is not yet 16 do not ask any more questions, tell them they are too young to buy a car.
Hide Assignment Information
|
|
Instructions | |
how do i create a program in python that :
* Determine which vehicle a driver may want to buy. and that Use at least 4 constants like vehicles types like truck, SUV, toyota,range rover and ask the users name and age, and if the user is not yet 16 do not ask any more questions, tell them they are too young to buy a car. that Ask a minimum of 3 yes or no questions.
|

a="Truck"
b="toyota"
c="range_rover"
d="SUV"
Q1 = input("Enter your username: ")
Q2=int(input("Enter your age: "))
if Q2 <16:
print ("you are too young to buy a car.")
else:
Q3=input("Is your budget less than 10 lacks")
if Q3 =="yes":
print("You can buy "+a)
elif Q3 =="No":
print("You can buy "+b)
else:
Q3=input("Is your budget less than 20 lacks")
if Q3 =="yes":
print("You can buy "+d)
elif Q3 =="No":
print("You can buy "+c)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images









