Alan Gauld wrote:
>> What values represent true in Python?
>>
>
> True
>
> Its a built-in boolean type value.
>
> But empty strings, lists, tuples etc are considered False
> Similarly zero and None are considered False
>
Let us be precise here. Empty things are considered False when used
w
> What values represent true in Python?
True
Its a built-in boolean type value.
But empty strings, lists, tuples etc are considered False
Similarly zero and None are considered False
The library reference has a full list somewhere, but it's pretty
much what intuition would tell you. "Empty" t
> What values represent true in Python?
good question. let's look at it from the other way as it's easier:
a Boolean False value is any zero or empty container while True is
anything *other* than those values. at the risk of plagarizing
myself, here is a clip from chapter 4 of "Core Python:"
C
What values represent true in Python?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor