-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhile.py
More file actions
38 lines (33 loc) · 849 Bytes
/
Copy pathwhile.py
File metadata and controls
38 lines (33 loc) · 849 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
32
33
34
35
36
37
38
"""
i = 1
while i <= 5:
print('*' * i)
i = i + 1
print("Done")
"""
command = ""
started = False
while True:
command = input("> ").lower()
if command == 'start':
if started:
print("Car is already started")
else:
started = True
print("Car started... Let's Go!")
elif command == 'help':
print("""
start - to start the car
stop - to stop the car
quit - to quit the game
""")
elif command == 'stop':
if not started:
print("Car is already stopped")
else:
started = False
print("Car Stopped!")
elif command == 'quit':
print("Thank you for playing :)")
else:
print("Sorry, I don't understand what is written here :(")