-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha624.py
More file actions
24 lines (23 loc) · 700 Bytes
/
a624.py
File metadata and controls
24 lines (23 loc) · 700 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
import sys
for s in sys.stdin:
password = s.rstrip()
score = 0
if len(password)>= 8:
score+= 1
words_only = "".join(char for char in password if char.isalpha())
if words_only != password and words_only != "":
score +=1
password = words_only
old = password
all_lower = password.lower()
all_upper = password.upper()
if old != all_lower and old != all_upper:
score += 1
if score == 3:
print("This password is STRONG")
elif score == 2:
print("This password is GOOD")
elif score == 1:
print("This password is ACCEPTABLE")
else:
print("This password is WEAK")