The Python Game Book

code games. learn Python.

User Tools

Site Tools


Sidebar

Github:

en:glossary:i:is

is

is operator in python, to test if two objects occupy the same place in memory.

See also : https://docs.python.org/3/reference/lexical_analysis.html#keywords

Use cases:

>>>x = None
>>>x is None
True
>>>x is not None
False
>>>a = 5
>>>b = a
>>>a is b
True

Not to confuse with the == operator for testing if two objects have the same value

en/glossary/i/is.txt · Last modified: 2020/12/20 19:04 by horst