20 lines
No EOL
625 B
Python
20 lines
No EOL
625 B
Python
import string
|
|
import random
|
|
|
|
letters = list(string.ascii_letters) # a-z + A-Z
|
|
symbols = list(string.punctuation)
|
|
numbers = list(string.digits) # 0-9
|
|
|
|
print("Welcome to the PyPassword Generator!")
|
|
pass_letters = int(input("How many letters would you like in your password?\n"))
|
|
pass_symbols = int(input("How many symbols would you like\n"))
|
|
pass_numbers = int(input("How many numbers would you like\n"))
|
|
|
|
|
|
l = random.choices(letters, k=pass_letters)
|
|
s = random.choices(symbols, k=pass_symbols)
|
|
n = random.choices(numbers, k=pass_numbers)
|
|
|
|
password = l + s + n
|
|
random.shuffle(password)
|
|
print(''.join(password)) |