import random
import string

def generate_password(length):
    # Define characters to include in the password
    characters = string.ascii_letters + string.digits + string.punctuation
    
    # Generate random password
    password = ''.join(random.choice(characters) for _ in range(length))
    
    return password

# Example usage
password_length = 12
random_password = generate_password(password_length)
print("Random Password:", random_password)

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: