maynul67

Random password generator

Jul 20th, 2021
1,223
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2. import string
  3. all_letters = string.ascii_letters
  4. all_numbers = string.digits
  5. all_special = string.punctuation
  6. all = all_letters+all_numbers+all_special
  7.  
  8. n = int(input("How many characters in your password?   "))
  9.  
  10. password = " "
  11. for char in range(0,n):
  12.     char = random.choice(all)
  13.     password = password + char
  14.    
  15.  
  16. print("your random password is :", password)
RAW Paste Data