Problem in boolean operator (Solved) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Problem in boolean operator (Solved)

Why is it showing false even as b's value is 13? https://code.sololearn.com/cMMfH02zprbA/?ref=app

11th Mar 2022, 4:15 AM
<k>Kartik</k>
2 Answers
+ 1
In Python input is always string. So in line 4 you are comparing strings to integers. No matter what you give as input this will always evaluate to False. Either convert your input to int. Or put the numbers in line 4 in quotation marks.
11th Mar 2022, 4:21 AM
Simon Sauter
Simon Sauter - avatar
0
Thank you Simon Sauter
11th Mar 2022, 4:22 AM
<k>Kartik</k>