PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def password_valid(password):
number_of_digits = 0
number_of_special_characters = 0
special_characters = ['!', '@', '#', '$', '%', '&', '*']
for x in password:
if x.isnumeric():
number_of_digits += 1
for x in password:
if x in special_characters:
number_of_special_characters += 1
if len(password)>=7 and number_of_digits>=2 and number_of_special_characters>=2:
return "Strong"
else:
return "Weak"
pw = input()
print(password_valid(pw))
Enter to Rename, Shift+Enter to Preview
OUTPUT
Запуск