question about True values

skip at pobox.com skip at pobox.com
Thu Oct 26 09:38:36 EDT 2006


    Skip>     string              ""
    Skip>     list                []
    Skip>     tuple               ()
    Skip>     dict                {}
    Skip>     int                 0
    Skip>     float               0.0
    Skip>     complex             0j
    Skip>     set                 set()
    Skip> 
    Skip> Any other value besides the above will compare as "not false".

    >> And today's question for the novices is: which Python type did Skip
    >> miss from the above list?

    Ben>        bool             False

In my rush to reply I missed several others as well.  Elucidation left as an
exercise for the reader.

Skip



More information about the Python-list mailing list