C
christhecomic
How do I bring users back to beginning of user/password question once they
fail it? thx
fail it? thx
How do I bring users back to beginning of user/password question once they
fail it? thx
How do I bring users back to beginning of user/password question once
they fail it? thx
username=raw_input("Please enter your username: ")
password=raw_input("Please enter your password: ")
if username == "john doe" and password == "fopwpo":
print "Login Successful"
else:
print "Please try again"
Here is my code...I'm using 2.7.5
username=raw_input("Please enter your username: ")
password=raw_input("Please enter your password: ")
if username == "john doe" and password == "fopwpo":
print "Login Successful"
else:
print "Please try again"
How do I bring users back to beginning of user/password question once they
fail it? thx
Can't seem to get this to cooperate...where does the while statement belong?
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.
And note that the getpass module is what you should use for that second
thing in real life, for the security of your users.
It's right, therefore I did not test it? I don't understand.
Hi,
Am 24.06.2013 14:12 schrieb (e-mail address removed):
while not username or not password or username != "john doe" or password
!= "fopwpo":
print "Please try again"
username=raw_input("Please enter your username: ")
password=raw_input("Please enter your password: ")
print "Login Successful"
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.