[Tutor] count

ChristopherNolen@aol.com ChristopherNolen@aol.com
Fri, 13 Oct 2000 12:22:36 EDT


When I run this the last 'print' in the while block prints even when the 
correct password is entered. I thought the lines in the while block only 
executed if the while constraints were met. How would I make the last print 
not show when the proper pasword is entered?thanks cmn


count = 0
print "Halt!"
input = raw_input("Who goes there? ")
while input != "Chris":
    print "Please move away from my machine!",input,"!!"
    input = raw_input("Who goes there? ")
    count = count + 1
    print "You have fondled my keys",count,"too many times!"
print "Chris, an erroneous password was entered",count,"times!"
print "WELCOME TO THE MACHINE, MASTER!"