-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path054.py
More file actions
24 lines (21 loc) · 648 Bytes
/
054.py
File metadata and controls
24 lines (21 loc) · 648 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# https://www.freecodecamp.org/learn/daily-coding-challenge/2025-10-03
def check_strength(password):
criteria_met = 0
if len(password) >= 8:
criteria_met += 1
if password != password.lower() and password != password.upper():
criteria_met += 1
for num in range(10):
if str(num) in password:
criteria_met += 1
break
for char in ["!", "@", "#", "$", "%", "^", "&", "*"]:
if char in password:
criteria_met += 1
break
if criteria_met < 2:
return "weak"
elif criteria_met < 4:
return "medium"
else:
return "strong"