Ask coding questions

← Back to all posts
Why my results are not accurate???
JW2005

This is abt a password checker. I have put the conditions and variables of a strong password but when I run and type a condition of a strong password, I cant get the accurate result and I cannot find the problem. Need help guys.

Voters
JW2005
Comments
hotnewtop
SixBeeps

In your logic, you're checking if password (a string) is equal to an instance of Strength (not a string) so those if statements will never execute.

The usage of classes here doesn't make sense. Do you need to use them?

JW2005

@SixBeeps actually I just try to make it simpler. If I can't do that how can I do that in a function? If it will be if else statements then I think it will be very long