+ 6
Please can anyone help me solve "Password validation" code coach program by modifying my program.[solved]
pasw=str(input()) schar=['!','@','#','
#x27;,'%','&','*'] nchar=['0','1','2','3','4','5','6','7','8','9'] pasln=len(pasw) for i in range(0,pasln,1): for i in schar and nchar: if pasln>=10: print("Strong") else: print("Weak")3 ответов
+ 3
I suggest you to create two empty lists one for digits and the other for symbols , then check if a character is a number or symbol then append it to the correspending list .finally count the lenghth of each list and compare it to the given conditions .
+ 4
When iterating check if the value is in schar and nchar separately. you have to satisfy both conditions independently.
use if statement for that.