while var, but var ==16 != true

Jeffrey Froman jeffrey at fro.man
Mon Jul 14 16:10:45 EDT 2008


Tim Roberts wrote:

> Everything has a boolean value in
> Python.  0, None, False, '' (empty string), [] (empty list), () (empty
> tuple), and {} (empty dictionary) all have a False value.  Everything else
> has a True value.

Empty set objects also evaluate as false in a boolean context.


Jeffrey



More information about the Python-list mailing list