vendredi 24 mai 2019

Why does python expect an indent for my elif statement despite level being consistent?

I don't understand why this python code does not work, I thought if any of the Usernames were entered it would then proceed to the next indented section.

However my elifs are showing an error of expected indent however, if I indent them they become part of the Frobinson username don't they?

if Username =='Frobinson':
    print('Please input password, the default password will be QWERTY')
    Password=input()
    if Password == 'QWERTY':

elif Username =='Jsmith':
    print('Please input password, the default password will be QWERTY')
    Password=input()
    if Password == 'QWERTY':

elif Username =='Joe':
    print('Please input password, the default password will be QWERTY')
    Password=input()
    if Password == 'QWERTY':


    menu() 

Aucun commentaire:

Enregistrer un commentaire