# Генератор паролей
import secrets
def generate_password(length=20, lower=True, upper=True, special=True):
lower_chars = 'abcdefghijklmnopqrstuvwxyz'
digits_chars = '0123456789'
special_chars = '!@#$%^&*()-_=+[]{}<>?/'
groups = [digits_chars]
if lower:
groups.append(lower_chars)
if upper:
groups.append(lower_chars.upper())
if special:
groups.append(special_chars)
if length < len(groups):
raise ValueError(f'Минимальная длина пароля: {len(groups)}')
password = [secrets.choice(group) for group in groups]
all_chars = ''.join(groups)
while len(password) < length:
password.append(secrets.choice(all_chars))
secrets.SystemRandom().shuffle(password)
return ''.join(password)
print(generate_password(10))
*текст* - жирный,
~текст~ - курсивный,
-текст- - _текст_ - подчеркнутый