Python

[Python] 비밀번호 생성기

망고고래 2024. 7. 4. 14:11

https://youtu.be/SqvVm3QiQVk?si=TgLEVUYDSAZaC9qA&t=2535

 

import random

print('Welcome To Your Password Generator')

chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*().,?0123456789'
number = int(input('Amount of passwords to generate: '))
length = int(input('Input your password length: '))

print('\nhere are your passwords:')
for pwd in range(number):
    passwords = ''
    for c in range(length):
        passwords += random.choice(chars)
    print(passwords)