Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- passcode = ''
- password = 5762
- attempts = 0
- def password_attempts(passcode, attempts):
- while passcode != password:
- attempts = attempts + 1
- num = input("Password please: ")
- num = len(num)
- passcode = str(passcode) + str(num)
- passcode = int(passcode)
- print(passcode)
- if attempts == 4:
- return passcode, attempts
- try_again = 'yes'
- while try_again == 'yes' or try_again == 'y':
- if passcode == password:
- print("Access Granted...")
- break
- elif attempts > 4:
- print('Breaking...')
- try_again = input("Try again? no to exit")
- password_attempts(passcode, attempts)
- print("Welcome to the end")
- print(passcode, attempts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement