TotteL

Car Thingie

Feb 27th, 2013
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. while True:
  2.  
  3.     print ("What would you like to calculate?")
  4.     print ("1. Reaction Distance")
  5.     print ("2. Breaking Distance")
  6.     print ("3. Stop Distance")
  7.  
  8.     A = raw_input('Chose your answer by typing "Reaction", "Break", "Stop" or "Quit" to exit: ')
  9.  
  10.     if A == "Reaction" or A == "reaction":
  11.         Speed = raw_input("Enter speed: ")
  12.         reactionS = raw_input("Enter the reacion time in seconds: ")
  13.         svar = (int(Speed) * int(reactionS)) / 3.6
  14.         print ("The breaking distance is: " + str(svar))
  15.     elif A == "Break" or A == "break":
  16.         print("Breaking Distance")
  17.     elif A == "Stop" or A == "stop":
  18.         print("Stop")
  19.     else:
  20.         quit()
Advertisement
Add Comment
Please, Sign In to add comment