Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >> def mar():
- pw = 'a' # password
- upw = input('enter pw') #user inputed password
- count = 3
- currentcount = 0
- while currentcount < count:
- if pw == upw:
- print('correct')
- exit()
- else:
- print('try again')
- currentcount = currentcount +1
- if currentcount == 3:
- print('youve been denied')
- exit()
- >>> mar()
- enter pwa #CORRECT password
- correct
- Traceback (most recent call last):
- File "<pyshell#18>", line 1, in <module>
- mar()
- File "<pyshell#17>", line 9, in mar
- exit()
- File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site.py", line 362, in __call__
- raise SystemExit(code)
- SystemExit: None
- >>> mar()
- enter pww #WRONG password
- sorry
- sorry
- sorry
- youve been denied
- Traceback (most recent call last):
- File "<pyshell#23>", line 1, in <module>
- mar()
- File "<pyshell#17>", line 15, in mar
- exit()
- File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site.py", line 362, in __call__
- raise SystemExit(code)
- SystemExit: None
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement