import random
import string
def generate_password(length=12):
"""Generate a random password with specified length."""
characters = string.ascii_letters + string.digits + string.punctuation
password = ''.join(random.choice(characters) for _ in range(length))
return password
# Example usage
if __name__ == "__main__":
password = generate_password()
print("Generated Password:", password)