import random
import string
def generate_password(length=16):
all_characters = string.ascii_letters + string.digits + string.punctuation
password = ''.join(random.choice(all_characters) for _ in range(length))
return password
# Example: Generate a password with default length (16 characters)
password = generate_password()
print
(password)
import string
def generate_password(length=16):
all_characters = string.ascii_letters + string.digits + string.punctuation
password = ''.join(random.choice(all_characters) for _ in range(length))
return password
# Example: Generate a password with default length (16 characters)
password = generate_password()
(password)