Skip to content

Instantly share code, notes, and snippets.

@bhuiyanmobasshir94
Created April 28, 2023 10:57
Show Gist options
  • Save bhuiyanmobasshir94/2335f5f2b3fe7426dfe9e30ae177d96d to your computer and use it in GitHub Desktop.
Save bhuiyanmobasshir94/2335f5f2b3fe7426dfe9e30ae177d96d to your computer and use it in GitHub Desktop.
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