Can someone check this code please? Most of it is working but when they type 'admin' it should allow them to set a new password 'type new password' but then the new password doent save. Can anyone help me fix it? Thanks
program = ("live")
while program == ("live"):
password = ("Python")
question = input("What is the password? ")
if question == password:
print ("well done")
if question == ("admin"):
n_password = input("What is the new password? ")
password = n_password
question = input("What is the password? ")
else:
question = input("What is the password? ")
("live")?input, you might like to considergetpass, it is in the standard library and very easy to use. By the way, check your logic flow. The user will be asked for the password twice in each loop (regardless ofadminor not).