New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Why is this not working properly?
I made this password validation code bit for practice but there's a problem: When input is hello@12, it finds it valid. My friend gave a random input "shin@chan1", it found invalid. Kindly solve this problem. Thankyou. https://code.sololearn.com/cdCxc6wJunCi/?ref=app
2 Answers
+ 4
Line 13 should not have -1 in the range definition. While there is, you never check the last character, which in the case you described is the sole digit. This is why the number check fails.
+ 1
Thanks brother.