. One way to do it is to use a While True and break statements.
Assuming that the correct password is “python1” or “python2”, write a password program to keep track of how many times the user has entered the password wrong. If it is more than 10 times, print 'You have been denied access.' and terminate the program.
If the password is correct, print 'You have successfully logged in.' and terminate the program. Also if the user enters “bye” or “quit” any time during the program, print the message “You want to quit the program. Nice day.” and terminate the program.
Re: Ex 1 with counted strikes
Assuming that the correct password is “python1” or “python2”, write a password program to keep track of how many times the user has entered the password wrong. If it is more than 10 times, print 'You have been denied access.' and terminate the program.
If the password is correct, print 'You have successfully logged in.' and terminate the program. Also if the user enters “bye” or “quit” any time during the program, print the message “You want to quit the program. Nice day.” and terminate the program.