Newbe: password program

Steve Holden sholden at holdenweb.com
Sat Jan 18 16:43:14 CET 2003


"pavs" <vze33v6m at verizon.net> wrote in message
news:eDcW9.7243$V75.2394 at nwrddc02.gnilink.net...
pavs> #Modify a password guessing program to keep track of how
pavs> #many times the user has entered the pasword wrong.
pavs> #If, it is more than 3 time, print "That must have been complicated."
pavs>
pavs> # ------------------------------------------------------------------
pavs>
pavs> #Waits untill password has been entered. Use Control -C to break out
witho
ut
pavs> # the password
pavs>
pavs> #Note that this must not be the password so that the while loop runs
atlea
st once
pavs>
pavs> password = "pavs"
pavs> count = 0
pavs>
pavs> while password != "unicorn":
pavs>     print "Wrong Password"
pavs>     password = raw_input("Password:")
pavs>     count = count + 1
pavs>
pavs>
pavs> print "Welcome in"
pavs> if count > 3:
pavs>     print "That must have been hard"
pavs>
pavs> :)
pavs> I think the program works.
pavs>
pavs> If so, than this would be my first workable program without outside
help :
)
pavs>
pavs> Python is so much FUN!
pavs>

Congratulations! You're right, Python *is* fun.

regards
--
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Bring your musical instrument to PyCon!    http://www.python.org/pycon/






More information about the Python-list mailing list