Не менее 8 символов, только латинские буквы, минимум 1 строчная буква, 1 прописная, 1 цифра, разрешены спецсимволы
Хелп,напишите пример такого пароля
По дате
По Рейтингу
Vadim110611
1234567891011121314151617181920212223242526272829303132333435363738394041
# Генератор паролей
import random
import string
def ispunct(ch):
return ch in string.punctuation
line = 'abcdefghijklmnopqrstuvwxyz01234567890123456789!#$%&()*+,-.;=>?@[]^_{}~ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lst = list(line)
j = 0
m = 20
while j < m:
mix = random.sample(lst, len(lst))
a = random.randint(8, 16)
b = 32
i = 0
lower = False
upper = False
digit = False
punct = False
basket = []
while True:
ch = random.choice(lst)
if ch.islower() and not lower:
lower = True
elif ch.isupper() and not upper:
upper = True
elif ch.isdigit() and not digit:
digit = True
elif ispunct(ch) and not punct:
punct = True
elif i > a and lower and upper and digit and punct:
break;
if i > b:
basket.clear()
i = 0
basket.append(ch)
i += 1
password = ''.join(basket)
print(password)
j += 1

3f=SjsP@
MeFeDr0nch!k
Bshej82#