[Tutor] Negative IF conditions

Kent Johnson kent37 at tds.net
Fri Feb 11 22:11:05 CET 2005


Bob Gailer wrote:
> At 01:38 PM 2/11/2005, Kent Johnson wrote:
>> Note that in Python in general, 'not x' and 'x == False' are not 
>> equivalent; 'not x' will be true for many more values than just False. 
>> For example
>> not 0
>> not 0.0
>> not []
>> not {}
>>
>> are all True.
> 
> 
> Oops. 0 and 0.0 do == False.

Uh, right. Thanks!

Kent



More information about the Tutor mailing list