Can anyone explain me why and how this code is giving output True | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can anyone explain me why and how this code is giving output True

print(2==2 and 3==4 or 2!= 3) https://code.sololearn.com/cvl252XzvroP/?ref=app

4th Feb 2022, 9:28 AM
IDIOT KID
IDIOT KID - avatar
2 Answers
+ 4
3==4 (false) [3 is not equal to 4 hence false] 2!=3 (true) [2 is not equal to 3 hence true] 2==2 (true) [2 is equal to 2 hence true] print(2==2 and 3==4 or 2!= 3) print( true and false or true) true and false = false [2==2 and 3==4] false or true = true
4th Feb 2022, 9:52 AM
Deep
Deep - avatar
+ 2
THANKS DEAR AWESOME EXPLANATION
4th Feb 2022, 10:07 AM
IDIOT KID
IDIOT KID - avatar