+ 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
Syed Abdul Muhit
Syed Abdul Muhit - avatar
1 Answer
+ 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