Skip to content
Advertisement

Why is my with statement skipped after while loop?

With this code (I added some prints to test where the code stops) I get this:

do you have your details stored here already? y/n y

Please enter a username Test

debug: username_exists is True

debug: I ran this command

do you have your details stored here already? y/n

JavaScript

Advertisement

Answer

You’re initializing pass_matches to None and then you’re checking pass_matches is False which will always return False because here pass_matches will always be None

modify the while statement with this line of code:

while pass_matches in (False, None)

Advertisement