+ 1

[SOLVED] Why is print(1<(2>1)) False?

(I) print(1<2>1) = True, (II) But print(1<(2>1)) = False; (III) Correspondingly, print(1<2>1 == 1<(2>1)) = False. What is the logic behind II? Please explain.

24th Nov 2020, 1:38 PM
Md. Niamul Ahad Chowdhury
Md. Niamul Ahad Chowdhury - avatar
1 Antwort
+ 4
1) 1<2>1 means in python 1>2 and 2>1. It's true 2) 1<(2>1) means (2>1) is true=1 then 1<(1) is false. 3) true == false => false
24th Nov 2020, 1:43 PM
Jayakrishna 🇮🇳