-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcarGame.py
More file actions
28 lines (28 loc) · 703 Bytes
/
carGame.py
File metadata and controls
28 lines (28 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
command = ""
started = False
while True:
command = input("> ").lower()
if command == "start":
if started:
print("Car already started!")
else:
started = True
print("Car started.. Ready to go!")
elif command == "stop":
if not started:
print("The car is already stopped")
else:
started = False
print("Car stopped!")
elif command == "help":
print("""
I do not understand that!
for start = Type "Start"
for stop = Type "Stop"
for quit = Type "Quit"
for help = Type "Help"
""")
elif command == "quit":
break
else:
print("I am sorry.. I do not understand!")