import random
state = 1
balance = random.randint(500,2500)
print (balance)
accounts= {
"swindrunner" : "1234",
"istormrage" : "abcd",
"tpgallywix" : "qwerty"
}
print (state)
while state == 1:
print (state)
userpass = ["swindrunner1234", "istormrageabcd", "tpgallywixqwerty"]
username = input("Username:")
password = input("Password: ")
#AccountInfo = username + password
print(userpass)
break
AccountInfo = username + password
state = 2
print(state)
while state == 2:
print(state)
print(AccountInfo)
if AccountInfo == "swindrunner1234" or AccountInfo == "istormrageabcd" or AccountInfo == "tpgallywixqwerty":
print ("ok")
state = 3
else:
print ("no")
state = 1
break
print(state)
while state == 3:
input("Display, Withdraw, Deposit, Exit")
How come when the AccountInfo variable is not equal to one of the 3 correct ones, it doesn’t prompt the user to enter another username and password? It should set the state back to = 1, which should prompt the user to re-enter them to try again. So why does it just end the code?