Python\'s "is" operator behaves unexpectedly with integers

Answer

Take a look at this:

>>> a =256>>> b =256>>> id(a)9987148>>> id(b)9987148>>> a =257>>> b =257>>> id(a)11662816>>> id(b)11662828

All python Questions

Ask your interview questions on python

Write Your comment or Questions if you want the answers on python from python Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---