Boolean types... confussion
Hello everyone :) I'm pretty new in Python (and I'm also trying to learn basic things by myself) and I'm trying to understand the boolean types, I have this example:
command = ""
started = False
stopped = False
while True:
command = input("> ").lower()
if command == "start":
if started:
print("Car is already started")
else:
print("Car started... ready to go!")
elif command == "stop":
if stopped:
print("Car is already stopped")
else:
print("Car stopped... ")
elif command == "help":
print("""
start - to start the car
stop - to stop the car
quit - to quit
""") #cuando usamos 3 comillas se ejecutan tambien los espacios que haya, así que hay que borrarlos
elif command == "quit":
break
else:
print("Sorry, I don't understand that!")
But I still don't understand when I need to use True and when False, if someone can explain it with very simple words I'll be very thankful.
Thanks!!! :D
Please sign in to leave a comment.