-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcar_game.py
More file actions
33 lines (30 loc) · 809 Bytes
/
Copy pathcar_game.py
File metadata and controls
33 lines (30 loc) · 809 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
29
30
31
command = ""
isStart,isStop=False,False
while True:
command= input(">").lower()
if command=="start":
if isStart==False :
print("Car started")
isStart=True
else:
print("Car is already started")
elif command=="stop":
if isStart==False:
print("Car is not started yet")
elif isStart==True and isStop==False:
print("Car stopped")
isStop=True
isStart=False
else:
print("Car is already Stopped")
isStop=False
elif command=="help":
print("""start - to start the car
stop - to stop the car
quit - to quit
""")
elif command=='quit':
print("Quit")
break;
else:
print("I don't understand that")