Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def vault() -> bool:
- pin = "".join([random.choice("0123456789abcdef") for _ in range(4)])
- digits = ["z", "z", "z", "z"]
- counter = 0
- print("What is the 4-digit PIN?")
- while True:
- attempt = list(input("Attempt> "))
- for _ in range(len(attempt)):
- digits.insert(0, attempt.pop())
- digits.pop()
- if "".join(digits) == pin:
- return True
- counter += 1
- if counter > MAX_DIGITS:
- return False
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement