I have having trouble with my num_char output in my random password generator. I am getting the number of passwords but not the length on each password. Can you solve this?
from random import choice
import string
def create_password():
num_passwords = int(input('How many passwords would you like? '))
num_char = int(input('How long would you like your password to be? '))
for j in range(num_passwords):
for k in range(num_char):
password = ''.join([choice(string.ascii_lowercase + string.ascii_uppercase + string.digits)])
num_passwords -=1
print(password)
create_password()
output:
y
t
K
S
7