Newbe: password program

pavs vze33v6m at
Sat Jan 18 14:27:38 CET 2003

#Modify a password guessing program to keep track of how
#many times the user has entered the pasword wrong.
#If, it is more than 3 time, print "That must have been complicated."

# ------------------------------------------------------------------

#Waits untill password has been entered. Use Control -C to break out without
# the password

#Note that this must not be the password so that the while loop runs atleast once

password = "pavs"
count = 0

while password != "unicorn":
    print "Wrong Password"
    password = raw_input("Password:")
    count = count + 1

print "Welcome in"
if count > 3:
    print "That must have been hard"


I think the program works.

If so, than this would be my first workable program without outside help :)

Python is so much FUN!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list