Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | None | 0 0
  1. #get the ammount of miles they are spending in the car
  2. yourUserInput = input("how long will your journey be in miles? ")
  3. yourUserGasPrice = input("how much does gas cost for you? ")
  4. # get thier car to get the gas efficiency, this method is not recomended if your using tons of value types.
  5.  
  6. yourUsersCar = input("what type of car do you have? (Nissan, JEEP or Ford) ")
  7. gasEfficient = 1 #the gas efficiency of the vehicle
  8. if yourUsersCar == "Nissan" or yourUsersCar == "nissan":
  9.     gasEfficient = 25
  10. elif yourUsersCar == "JEEP" or yourUsersCar == "jeep" or yourUsersCar == "Jeep":
  11.     gasEfficient = 15
  12. elif yourUsersCar == "Ford" or yourUsersCar == "ford":
  13.     gasEfficient = 20
  14. else:
  15.     print("you did not enter a valid car")
  16.  
  17. cost = int( yourUserInput )/gasEfficient*int( yourUserGasPrice )
  18.  
  19. print(cost)
  20.  
  21. input("press enter to exit the program")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement