Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import string
- import random
- def gen_pas():
- pas = []
- count = int(raw_input('Enter the length of your password: '))
- type_pas = str(raw_input('Enter the type that you prefer: "strong" or "weak". '))
- if type_pas == 'strong':
- for i in range(count):
- pas.append(random.choice(string.letters + string.digits + string.punctuation))
- elif type_pas == 'weak':
- for i in range(count):
- pas.append(random.choice(string.ascii_lowercase + string.digits))
- random.shuffle(pas)
- return ''.join(pas)
- print gen_pas()
Add Comment
Please, Sign In to add comment