newbie password question

EtrOFsouls etrofsouls at aol.com
Sat Mar 2 00:35:14 EST 2002


Im a newbie to programming, and am having trouble with a certain task. I'd like
to know how to keep track of how often a person guesses at a password and
limits it to x many guesses. Here's a sample of what I've got so far.

password = "foobar"

while password != "unicorn":
      password = raw_input ("Password:")
print "Welcome In"

I understand all this (thank god), but I'm having trouble figuring out how to
get it to keep track of the number of guesses and then print a message such as
"Halt, you do not have access!" if the number of guesses exceeds the limit. I'm
learning this thru on-line tutorials and this was given as an excersise. All I
have to work with is variables and statements such as...while, if, elif and
else. 

Any help would be greatly appreciated



More information about the Python-list mailing list