0

Password Validation

Only having problem with case 11.. help pls password = str(input()) #code goes here def validate(pas): intt = "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" charr = '!', '@', '#', '

#x27;, '%', '&', '*' u = 0 i = 0 n_intt = "" n_charr = "" if len(pas) > 6: while (u < len(intt)) and (i < len(charr)): if (intt[u] in pas) or (charr[i] in pas): n_intt += "".join(intt[u]) n_charr += "".join(charr[i]) u += 1 i += 1 if ((len(n_intt) > 1) & (len(n_charr) > 1)): print("Strong") else: print("Weak") else: print("Weak") validate(password)

10th Nov 2021, 10:18 AM
Pee Frosh
Pee Frosh - avatar
1 Antwort
+ 1
def validatePassword(password): ints=[str(x) for x in range(10)] chars=[char for char in "!@#$%&*"] if len(password)>6: integers=[it for it in ints if it in password ] characters=[ ch for ch in chars if ch in password ] if len(integers)>1 and len(characters)>0: print("Strong") else: print("Weak") else: print("Weak") pwd=input("Enter your password : ") validatePassword(pwd)
10th Nov 2021, 11:46 AM
Jasy Fabiano
Jasy Fabiano - avatar