Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #get the ammount of miles they are spending in the car
- yourUserInput = input("how long will your journey be in miles? ")
- yourUserGasPrice = input("how much does gas cost for you? ")
- # get thier car to get the gas efficiency, this method is not recomended if your using tons of value types.
- yourUsersCar = input("what type of car do you have? (Nissan, JEEP or Ford) ")
- gasEfficient = 1 #the gas efficiency of the vehicle
- if yourUsersCar == "Nissan" or yourUsersCar == "nissan":
- gasEfficient = 25
- elif yourUsersCar == "JEEP" or yourUsersCar == "jeep" or yourUsersCar == "Jeep":
- gasEfficient = 15
- elif yourUsersCar == "Ford" or yourUsersCar == "ford":
- gasEfficient = 20
- else:
- print("you did not enter a valid car")
- cost = int( yourUserInput )/gasEfficient*int( yourUserGasPrice )
- print(cost)
- input("press enter to exit the program")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement