+ 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")

13th Jun 2020, 8:58 AM
Varun N
Varun N - avatar
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 .
13th Jun 2020, 1:05 PM
Hisham YUM 🇲🇦
Hisham YUM 🇲🇦 - avatar
+ 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.
13th Jun 2020, 9:07 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar