Facebook
From Sexy Bison, 3 Years ago, written in Python.
Embed
Download Paste or View Raw
Hits: 97
  1. #Introduction
  2. print('Hey there!')
  3. print('We are going to need some information on your car.')
  4.  
  5. while True:
  6.     proceed = input('Would you like to continue? (y/n): ')
  7.     if proceed.lower().startswith('y'):
  8.         print('Okay, here we go')
  9.         break
  10.     elif proceed.lower().startswith('n'):
  11.         print('Have a nice day! Exiting program... ')
  12.         exit()
  13.  
  14.         #I'm not sure if the above code is right
  15.         #I basically kept experiementing and got it to work lol.
  16.  
  17.  
  18. #Car info user prompts and storage
  19.  
  20. car_info = {} #Dictonary
  21.  
  22. while True:
  23.     car_info['car_brand'] = input('What brand is your car? :')
  24.     car_info['car_model'] = input('What model is it? :')
  25.     car_info['car_year'] = input('What year is your car? :')
  26.     car_info['odo_start'] = input("What was your car's starting odometer reading?:")
  27.     car_info['odo_end'] = input("What was your car's ending odometer reading? :")
  28.     car_info['car_MPG'] = input("What is your car's MPG? :")
  29.  
  30.     print(car_info)
  31.  
  32.     checkwork = input('Is everything correct? (y/n): ')
  33.     if checkwork == 'n':
  34.         print('No worries! We will start again.')
  35.         continue
  36.  
  37.     else:
  38.         break
  39.  
  40. print("Thank you!")
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.