Created
April 28, 2023 10:57
-
-
Save bhuiyanmobasshir94/2335f5f2b3fe7426dfe9e30ae177d96d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
orginal_pin = int(input("Enter your 4 digits pin: ")) | |
attempts = 0 | |
while True: | |
# Generate a random 4-digit number | |
pin = random.randint(1000, 9999) | |
attempts += 1 | |
if orginal_pin == pin: | |
break | |
# Print the attempts | |
print(f">>> Your pin took `{attempts}` attempts to crack :3") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment