lundi 22 novembre 2021

How to use two if statements simultaneously in python [closed]

So I am just a beginner who is trying to learn python and I came across this code while doing it, and I, for some reason just can't make any heads or tails of it

command = ""
started = False
while command != "quit ":
 command = input(">").lower()
 if command == "start":
     if started:
         print("car started")
     else:
         started = True
         print("the car has already started")

like I just don't understand how to use these two if statements simultaneously, I tried looking for it but couldn't find anything, so here I am, looking for some enlightenment.

Aucun commentaire:

Enregistrer un commentaire