Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import string
- LETTERS = string.ascii_letters
- NUMBERS = string.digits
- PUNCTUATION = string.punctuation
- def random_pswd(m):
- chars = LETTERS + NUMBERS + PUNCTUATION
- pswd = ""
- for j in range(m):
- pswd += random.choice(chars)
- return pswd
- m = int(input("Enter password length: "))
- print(random_pswd(m))
Add Comment
Please, Sign In to add comment