Please help me in python. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Please help me in python.

I don't know why this code isn't returning True. https://code.sololearn.com/cyKQz3rVQo83/?ref=app

14th Mar 2019, 4:30 PM
Abdul S Ansari
Abdul S Ansari - avatar
5 Answers
+ 4
because password[i] can't be in both in the string of letters and the string of numbers.
14th Mar 2019, 4:35 PM
LONGTIE👔
LONGTIE👔 - avatar
+ 2
Samad Sama It's pure logic. A character can't be a letter and a number at the same time.
14th Mar 2019, 4:44 PM
Diego
Diego - avatar
+ 1
LONGTIE, is there any special reason behind this or it just a rule or something? Can you tell me?
14th Mar 2019, 4:37 PM
Abdul S Ansari
Abdul S Ansari - avatar
+ 1
Change and to or in if condition. Then you will get True. As per your code, you are expecting both character and digits in same index - password [i] and this is impossible...!!! "hope this helps...
14th Mar 2019, 4:46 PM
Kuri
Kuri - avatar
0
Diego, Got it And Thank you
14th Mar 2019, 4:45 PM
Abdul S Ansari
Abdul S Ansari - avatar