Can someone help me please? I’m getting an error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can someone help me please? I’m getting an error

https://code.sololearn.com/ctB1DQD9upQe/?ref=app The function assigns one point for each strong password feature the given password has. If the total points at the end of the check is equal to four, the function should return "Strong" for three points "Good" for two "Fair" and for one or less "Weak."

30th Sep 2021, 12:33 PM
Triz
Triz - avatar
5 Answers
+ 2
I found a number of problems with this code: 1. first of all your code prints nothing because your function return count before it can return strings.... 2. your password will always be strong even if you input lower case characters only because you increment count every time you see lowercase character as well as any other characters. this could be fixed with use of few "bool" variables(see code below) 3. you had some trouble with TABs in your code... 4. the way you checked for upper lower and numbers didnt seem to work, so i fixed it with isdigit(), isupper() and islower() functions (see code below) and finally 5. (i didnt fix this one cuz i wasnt sure whether you did that on purpose or that was a mistake) If password is smaller than 8 characters it will be automatically weak so here is a fixed code: https://code.sololearn.com/cPb8T6TmqEZ4/?ref=app
30th Sep 2021, 1:09 PM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
+ 1
Thank you very much! And regarding number 5, yes the password should have 8 characters or more.
30th Sep 2021, 2:07 PM
Triz
Triz - avatar
+ 1
Triz , there is no need to credit me really...
30th Sep 2021, 2:47 PM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
0
It checks to ensure that the password has: At least 8 characters. A mixture of both uppercase and lowercase letters. A mixture of letters and numbers. Inclusion of at least one special character, e.g., ! @ # $ ]
30th Sep 2021, 12:35 PM
Triz
Triz - avatar
0
Aleksei Radchenkov How do I credit you for assisting me with this? Should I use the “#” feature? What should I include ?
30th Sep 2021, 2:08 PM
Triz
Triz - avatar