question about True values

Fulvio fulvio at tm.net.my
Thu Oct 26 14:51:43 EDT 2006


***********************
Your mail has been scanned by InterScan MSS.
***********************


On Thursday 26 October 2006 02:56, John Salerno wrote:
>  >>> s = 'hello'
>  >>> s == True
> False
>  >>> if s:
>         print 'hi'
>
this isn't only a python behavior.
the  "if" test is valid for all non-zero variables. only None, 0 and False 
make the condition to jump over.

F





More information about the Python-list mailing list