please explain | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

please explain

i = (not 1 > 100) print(int(i) == 1) print(int(i) > 7) out put: true false. why?

31st Aug 2016, 10:30 AM
ankur pancholi
ankur pancholi - avatar
2 Answers
+ 1
Hy it's very simple dude.. !! First condition 1: i=(not 1>100) //this condition is true. True means 1 (i=1) Second condition 2: int(i)==1 //this condition also true.. Bcoz 1==1 Third condition 3: Int(i)>7 //this condition is false.. i=1 ... So 1>7 => this condition is false.. That's all
19th Jan 2017, 11:57 AM
Murali S
Murali S - avatar
0
I = (not 1>100) # it is True Int(i) == 1 ( coz True == 1 and False == 0) So print (1==1) # it is True Print (1>7) # it is False
31st Aug 2016, 11:06 AM
Leshark
Leshark - avatar