Victor Noagbodji wrote:
Hello,

what's the difference between these two statement? And which one should one use?


if name ...

Will be false if:

name is an integer == 0
name is a float == 0
name is an empty string
name is an empty list
name is an empty dictionary

There are others, but you get the idea.

If name is not None:

Is false only if name is not None but will
be true for all the others.

-Larry
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to