In <[email protected]>
=?UTF-8?B?Q2hyaXMg4oCcS3dwb2xza2HigJ0gV2Fycmljaw==?= <[email protected]>
writes:
> > while True:
> > username = raw_input("Please enter your username: ")
> > password = raw_input("Please enter your password: ")
> >
> > if username == "john doe" and password == "fopwpo":
> > print "Login Successful"
> > break
> >
> > else:
> > print "Please try again"
> You didn't test the code, did you? Because the code you posted is
> right.
It's right, therefore I did not test it? I don't understand.
If the code has a bug, please point it out.
> And note that the getpass module is what you should use for that second
> thing in real life, for the security of your users.
I'm sure this is just an exercise for the OP to understand loops. Security
would be counter-productive.
--
John Gordon A is for Amy, who fell down the stairs
[email protected] B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list