+ 1
What's wrong with the code?
It works very well but just doesn't work with case 4 import string pw=list(str(input())) x=list(string.punctuation) t=['1','2','3','4','5','6','7','8','9','0'] p=[i for i in x if i in pw] j=[i for i in t if i in pw] if len(p)>=2 and len(j)>=2 and len(x)>=7: print("Strong") else: print("Weak")
7 ответов
+ 2
Oh Great thank you
0
It says the pw has to contain at least 2 from ('!', '@', '#', '#x27;, '%', '&', '*')
0
I replaced x by ('!', '@', '#', '#x27;, '%', '&', '*') but still not working
0
Just an idea, maybe try set comprehension instead of list, in p and j.
Reason: If the same special character appears twice in the password, maybe it should only be counted once. I am not sure if the test cases cover this, though.