|
Post by Qwerty on May 24, 2017 21:45:56 GMT -6
Hi there! I attended a camp one the 23rd in Port Arthur. I'm attempting to make a password login thing--using a script taught in the camp--that after 5 attempts will print the password. The problem I'm having is I don't know how to make it give you the option to attempt again. Here is the script I've written so far. Thank you in advance!
#password
password=('qwerty')
spam=0
if spam>5:
print('password')
print('Please enter your password')
myPassword=input()
if myPassword==password:
print('Correct')
else:
print('Incorrect, try again')
spam=spam+1
|
|
|
Post by _GrimmCreeper_ on May 24, 2017 22:24:26 GMT -6
If I understand what you want to do, I would put it in a while loop:
In Python 3 I think you have to replace "raw_input" with "input" but I'm not sure. There may be other changes as well. I am still running 2.7, so I'm not sure.
Also, the forum removes indents for some reason. Maybe the spam filter. I will see if I can fix it but for now, you can probably figure out where to put an indent. If you need any more help just ask!
|
|
|
Post by QwertyCM on May 24, 2017 22:31:46 GMT -6
Ok thanks!
|
|
|
Post by _GrimmCreeper_ on May 24, 2017 22:46:36 GMT -6
No problem! hope it works!
|
|
|
Post by QwertyCM on May 25, 2017 0:24:51 GMT -6
It did thank you! I forgot that continue was a logic statement. Is that what you call the orange?
|
|
|
Post by spohnz on May 25, 2017 13:18:13 GMT -6
Great work Grimm, QwertyCM, thank you for using the forum. Hopefully you can help others with the same issue that join. One thing I don't like is the 'code' doesn't tab over like it is suppose to when you insert 'code' in the forum. We will need to correct that.
|
|