+ 1
Why is this happening?
my_list = [False] print(bool(my_list)) #output: True
1 Answer
0
Hi,
You have the same with this.
my_list = [False, "foo", "bar"]
print(bool(my_list)) #output: True
You can mix type in a list. So convert a list in a bool is equal to convert something in bool, and something in bool is true. If you want convert element, you have to select index of this element.



