Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #random password generator
- import string
- from random import choice
- characters = list(string.printable)
- #not sure about the last 2 characters and some of the others so might need
- #to use other strings from the library and join.
- def generate_password(len):
- password = ""
- for i in range(len):
- char = choice(characters)
- password += char
- return password
- print(generate_password(7))
Add Comment
Please, Sign In to add comment