I've been searching around nearly all morning looking for a piece of code that can help me here but its hard to find one that is similar! I have to create a bank system that asks the user to input a username and password. If these are entered 3 times the system shuts down. So far, i have got my program to know if the password/username is correct or not. Now i just need to figure out how to make it run and stop after 3 incorrect attempts. Really appreciate any help given on this one! Thanks
Code:
username = "bank_admin"
password = "Hytu76E"
usernameGuess = raw_input("Please enter your username: ")
passwordGuess = raw_input("Please enter the password: ")
while (username != usernameGuess or password != passwordGuess):
print ("Please try again.")
usernameGuess = raw_input("Please enter your username: ")
passwordGuess = raw_input("Please enter your password: ")
print ("Password accepted. Access Authorized.")