创建一个程序来生成随机密码。
密码长度：12
是否包含数字：是
是否包含特殊字符：是
import random
import string

password_length = 12
include_digits = True
include_special_chars = True

lowercase_letters = string.ascii_lowercase
uppercase_letters = string.ascii_uppercase
digits = string.digits
special_chars = string.punctuation

if include_digits:
    lowercase_letters += digits
    uppercase_letters += digits

if include_special_chars:
    lowercase_letters += special_chars
    uppercase_letters += special_chars

password = ''
for i in range(password_length):
    if i == 0:
        password += random.choice(uppercase_letters)
    else:
        password += random.choice(lowercase_letters)

print(password)