[Tutor] Noob requesting help...

John Luke crunchman2600 at gmail.com
Sun Feb 17 00:18:35 CET 2008


Hi, I've recently started to get into Python, and I've made a bit a progress
so far, but I still have a long way to go. Along my search for tutorials,
I've come across this:

# Waits until a 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 at least once.
password = "foobar"

# note that != means not equal
while password != "unicorn":
    password = raw_input("Password: ")
print "Welcome in"



I understand *what's* going on, but I don't understand *why* it's happening.
To be more specific, I don't understand why the actual password, "unicorn",
is what it is, even though I set the password to "foobar"(password =
'foobar'), and later even stated that the password wasn't "unicorn"(while
password != 'unicorn':). Any help would be greatly appreciated. Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20080216/d74f133a/attachment.htm 


More information about the Tutor mailing list