-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProject2.py
More file actions
41 lines (29 loc) · 758 Bytes
/
Copy pathProject2.py
File metadata and controls
41 lines (29 loc) · 758 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Password Strength Checker
password = input("Enter Your Password: ")
score = 0
# Check password length
if len(password) >= 8:
score += 1
# Check uppercase letter
if any(char.isupper() for char in password):
score += 1
# Check lowercase letter
if any(char.islower() for char in password):
score += 1
# Check digit
if any(char.isdigit() for char in password):
score += 1
# Special characters
special = "!@#$%^&*"
# Check special character
if any(char in special for char in password):
score += 1
# Display result
print("\nPassword Analysis")
print("-" * 30)
if score <= 2:
print("Password Strength : WEAK")
elif score == 3 or score == 4:
print("Password Strength : MEDIUM")
else:
print("Password Strength : STRONG")