password generator using random module
import string import random def password_generator(size): chars = string.ascii_lowercase + string.ascii_uppercase + string.digits + string.punctuation return ''.join(random.choice(chars) for _ in range(size)) print(password_generator(16))