+ 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")
3 Antworten
+ 1
Why len(li3) == 2?
Try
len(li3) >=2
+ 2
Where's your test for the defined special characters?
0
it will append in empty list li3