0
Why is this output False?
print (bool([]))
2 Answers
+ 1
because it is empty. empty == none. none == false.. This applies to strings, sets, dicts, lists, etc..
0
Hi,
[] is an empty array so not exist then bool([]) = false
[0] isn't empty and return one value (=0), then bool([0]) = true