Advertisement
imtiazaasif

car game while loop .py

May 3rd, 2020
714
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. command = ""
  2. while True:
  3.     command = input('> ').lower()
  4.     if command == 'start':
  5.         print('car is started....')
  6.     elif command == 'stop':
  7.         print('car stopped')
  8.     elif command == 'help':
  9.         print("""
  10.        start - to start the car
  11.        stop - to stop the car
  12.        quit - quit the car""")
  13.     elif command == "quit":
  14.         break
  15.     else:
  16.         print("sorry i dont understand u")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement