PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import re
def validate_password(password):
min_length = 7
has_upper = re.compile(r'[A-Z]')
has_digit = re.compile(r'[0-9]')
has_special = re.compile(r'[!@#$%^&*(),.?":{}|<>]')
if has_special.search(password ) and len(password) > min_length and has_digit.search(password) and has_upper.search(password):
print("Strong")
else:
print("Weak")
password = input()
validate_password(password)
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run