find all multiplicands and multipliers for a number

Dave Farrance DaveFarrance at OMiTTHiSyahooANDTHiS.co.uk
Sat Apr 11 05:03:15 EDT 2015


$ python2
Python 2.7.8 (default, Oct 20 2014, 15:05:19) 
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 256
>>> b = 256
>>> a is b
True
>>> a = 257
>>> b = 257
>>> a is b
False
>>> 

It's not safe to use 'is' to compare integers.

Use ==



More information about the Python-list mailing list