dimanche 7 avril 2019

Which is the proper indentation on this "if statements" in python3?

I have a problem understanding why this block of code is running without the traditional identation on python3, It actually looks odd...

I have tried different indentations on the "if statements" and if I modify them an error will happend.

while True:
    # First Input Loop
    while loop == 4:
        if loop == 4:

            print("Very long foo.")
            print("(foo.)")
            print("There is a Small Mailbox.")
            second = input("What do you do? ")

        if second.lower() == ("take mailbox"):

            print("It is securely anchored.")

        elif second.lower() == ("open mailbox"):

            print("Opening the small mailbox reveals a leaflet.")

Aucun commentaire:

Enregistrer un commentaire