Someone wrote in [community profile] intro_to_cs 2010-11-22 01:44 am (UTC)

Re: Ex 1 with counted strikes

. 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.

Post a comment in response:

This community only allows commenting by members. You may comment here if you're a member of intro_to_cs.
(will be screened if not on Access List)
(will be screened if not on Access List)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting