0

Where is a bug ? Help me please

Task: Write a program that takes in a string as input and evaluates it as a valid password. The password is valid if it has at a minimum 2 numbers, 2 of the following special characters ('!', '@', '#', '

#x27;, '%', '&', '*'), and a length of at least 7 characters. If the password passes the check, output 'Strong', else output 'Weak'. https://code.sololearn.com/cosSgFQIwQuT/?ref=app

5th Apr 2020, 2:53 AM
Aldi Rasta Adrian
Aldi Rasta Adrian - avatar
2 Réponses
+ 1
You can also find by this way: password=input() password=list(password) numcount,symcount=0,0 for i in password: if i in '!@#$%&*': symcount+=1 if i.isdigit(): numcount+=1 if symcount>=2 and numcount>=2 and len(password)>=7: print('Strong') else: print('Weak')
5th Apr 2020, 3:43 AM
Azi 🇺🇿
0
okey , thank u for solution. i think my algorithm is bad
5th Apr 2020, 3:58 AM
Aldi Rasta Adrian
Aldi Rasta Adrian - avatar