+ 1

Please explain any one that why this code not qualifying last test case

https://code.sololearn.com/cPFB5YZEqY4z/?ref=app

31st Jan 2023, 9:24 AM
Manjunath Badiger
Manjunath Badiger - avatar
4 Antworten
+ 2
You have "2," (Extra camma)... , instead of "2"
31st Jan 2023, 9:32 AM
Jayakrishna 🇮🇳
+ 8
JuZip , this task is from code coach, a part of the task description is: >> 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'. so the the special characters/ symbols are sufficient, no need to import punctuation from module strjng.
31st Jan 2023, 10:36 AM
Lothar
Lothar - avatar
+ 2
Hi Manjunath Badiger I think it's because of the amount of punctuation you test for. There are more than you include in your list. See python string module: https://docs.python.org/3/library/string.html There is the string.punctuation that contains: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~. You could use this as variable to test. don't forget to import string
31st Jan 2023, 9:31 AM
JuZip
+ 1
Thank all of u for ur helpful replies..🧡
31st Jan 2023, 3:23 PM
Manjunath Badiger
Manjunath Badiger - avatar