Why not 34 gives false ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why not 34 gives false ?

When I write not 34 in IDLE it gives False, Why?

26th Dec 2019, 2:04 AM
Twiddle
Twiddle - avatar
3 Answers
+ 4
The boolean value of any number different than 0 is True, so bool(34) returns True. So not 34 is same as not True is same as False
26th Dec 2019, 2:08 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 1
Aymane Boukrouh Nice explanation. 👍
26th Dec 2019, 4:46 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
Rik Wittkopp thanks!
26th Dec 2019, 4:46 AM
Aymane Boukrouh
Aymane Boukrouh - avatar