[HELP] 12 cases passed. what's the wrong of the code? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

[HELP] 12 cases passed. what's the wrong of the code?

my code here : import re ptr='^(?=.*\W{2,})(?=.*\d{2,}).{7,}

#x27; st=input() #print(re.findall(ptr,st)) if re.findall(ptr,st): print("Strong") else: print("Weak")

5th Apr 2020, 3:42 PM
shahek ahmed
shahek ahmed - avatar
1 Antwort
+ 1
Your code will only work if either the numbers or characters are bonded and uninterrupted like "98" or "@%" will work,, but "9@8%" won't (the two numbers are now interrupted), so try to find an approach to check for the occurence even if they are scattered randomly, you might need a for loop to check the whole array.
5th Apr 2020, 4:05 PM
Mo Hani
Mo Hani - avatar