Search notes:

Python: NoneType

Type of None is NoneType

>>> type(None)
<class 'NoneType'>

Comparison

None can be compared to a scalar:
x = 42
y = None

if x == y:
   print("they're the same")
else:
   print("they differ")

x = None
y = None

if x == y:
   print("they're the same")
else:
   print("they differ")
Github repository about-python, path: /types/NoneType/comparison.py

See also

Other Python types

Index