+ 1

Code coach password validation

Every outputs are correct even though there are 2 test cases are failed what is the reason? user_input=input() li1=[] li2=[] li3=[] for i in user_input: if 48<=ord(i)<=57: li1.append(i) elif 65<=ord(i)<=90 or 97<=ord(i)<=122: li2.append(i) else: li3.append(i) if len(user_input)>=7 and len(li1)>=2 and len(li3)==2: print("Strong") else: print("Weak")

19th Mar 2020, 2:24 PM
MA Azjath
MA Azjath - avatar
3 Respostas
+ 1
Why len(li3) == 2? Try len(li3) >=2
19th Mar 2020, 4:10 PM
Jayakrishna 🇮🇳
+ 2
Where's your test for the defined special characters?
19th Mar 2020, 2:42 PM
HonFu
HonFu - avatar
0
it will append in empty list li3
19th Mar 2020, 2:46 PM
MA Azjath
MA Azjath - avatar