+ 1
Why does the test case 4 is wrong?
n = input() a = 0 b = 0 for i in n: if i in "1,2,3,4,5,6,7,8,9": a = a+1 if i in "'!', '@', '#', '
#x27;, '%', '&', '*'": b = b+1 if b >= 2 and a >= 2: print("Strong") else: print("Weak")4 Answers
+ 4
Remove the extra characters from your strings or change them completely to a list or tuple.
"1234567890"
"!@#$%&*"
The commas and single quotes are being counted as well.
+ 3
There will be additional needed at least 7 characters.
+ 2
You forgot one thing: The length of the password must be greater (or equal) than 7 =>
n = input()
a = 0
b = 0
for i in n:
if i in "1,2,3,4,5,6,7,8,9":
a = a+1
if i in "'!', '@', '#', '#x27;, '%', '&', '*'":
b = b+1
if b >= 2 and a >= 2 and len(n) >= 7:
print("Strong")
else:
print("Weak")
+ 2
Thanks