Test 0 and false since false is 0

Rick Johnson rantingrickjohnson at gmail.com
Fri Jul 7 00:25:11 EDT 2017


On Thursday, July 6, 2017 at 10:00:36 PM UTC-5, Sayth Renshaw wrote:
> Is there an "is not" method that's not != so I can check is not false.

Maybe. Or maybe /not/. :-P"

One way to find out would be to fire up your python
interpretor, and do some interactive testing. Here, allow me
to cinge my eyebrows:

    ## Python 2.x
    >>> 1 is 1
    True
    >>> 1 is not 1
    False
    >>> 1 is not 2
    True

I love the smell of roasted Python in the morning.



More information about the Python-list mailing list