forked from codehouseindia/Python-Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCar Game.py
More file actions
27 lines (26 loc) · 650 Bytes
/
Car Game.py
File metadata and controls
27 lines (26 loc) · 650 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
command = ""
started = False
while True:
command = input("> ").lower()
if command == "help":
print("""
start - to start a car
stop - to stop a car
quit - to
""")
elif command == "start":
if started:
print("Car is already started")
else:
started = True
print("Car started ")
elif command == "stop":
if not started:
print("Car is already stopped")
else:
started = False
print("Car stopped")
elif command == "quit":
break
else:
print("I don't understand...")