Joined April 2014
·

Fábio C. Barrionuevo da Luz

Palmas, Tocantins, Brazil
·
·

Posted to Python is vs == over 1 year ago
>>> a = 500
>>> b = a
>>> c = 500
>>> help(id)
Help on built-in function id in module __builtin__:

id(...)
    id(object) -> integer

    Return the identity of an object.  This is guaranteed to be unique among
    simultaneously existing objects.  (Hint: it's the object's memory address.)

>>> id(a)
33024604
>>> id(b)
33024604
>>> id(c)
33024628
>>>
>>> a == b
True
>>> a is b
True
>>> a == c
True
>>> a is c
False
>>>
Achievements
49 Karma
0 Total ProTip Views