PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Task:
"""Write a program that takes in a string as input and evaluates it as a valid password. The password is valid if it has at a minimum 2 numbers, 2 of the following special characters ('!', '@', '#', '$', '%', '&', '*'), and a length of at least 7 characters.
If the password passes the check, output 'Strong', else output 'Weak'."""
# Input Format:
'A string representing the password to evaluate.'
# Output Format:
"""A string that says 'Strong' if the input meets the requirements, or 'Weak',if not."""
# Sample Input:
a='Hello@$World19 '
# Sample Output:
'Strong '
p=input() or a
print('Strong'if len(p)>=7 and
len([i for i in p
if not i.isalnum()])>=2 and
len([i for i in p
if i.isnumeric()])>=2
else'Weak')
#p=input() or a
#p1=[i for i in p if not i.isalnum() if not i.isspace()]
Enter to Rename, Shift+Enter to Preview
OUTPUT
Запуск