0

Code Coach Password Validator

My code for the code coach password validator fails test case 7 and I can’t figure out why. Can anyone help me? https://code.sololearn.com/c29wGB6fpBRh/?ref=app

9th Mar 2020, 6:56 PM
JuhJ
JuhJ - avatar
2 ответов
+ 1
This may help you, password=input() scount=0 numcount=0 spec=['!', '@', '#', '
#x27;, '%', '&', '*'] num='0123456789' strength="" for char in password: for c in password: if char in spec: scount+=1 if char in num: numcount+=1 if scount>1 and numcount>1 and len(password)>7: strength="Strong" else: strength="Weak" print(strength)
9th Mar 2020, 8:08 PM
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~ - avatar
+ 1
import re password= input() x = True while x: if (len(password)<7 or len(password)>999): break elif not re.search("[a-z]",password): break elif not re.search("[0-9]",password): break elif not re.search("[!@#$%&*]",password): break else: print("Strong") x=False break if x: print("Weak")
4th Apr 2020, 8:51 PM
JAHANGEER LATEEF WANI
JAHANGEER LATEEF WANI - avatar