Python Day 11
Same car game but inform the user when the car is already running and already stopped.
command = ""
started = False
stopped = False
while True:
command = input("> ").lower()
if command == "start":
if started:
print("Car is already started !")
else:
started = True
print("Car Started....")
elif command == "stop":
if stopped:
print("Car is already stopped!")
else:
stopped = True
print("Car Stopped")
elif command == "help":
print("""Start - to start the car
Stop - to stop the car
quit - to quit""")
elif command == "quit":
break
else:
print("Sorry, i don't understand")