Built-in Constants in Python

Table of Contents

This article explains all constants which are under built-in namespace of python.

In python, there are only six built-in constants. False, True, None, NotImplemented, Ellipsis( ...) and __debug__ are built-in constants in python.

False

False value is of type bool and we can not assign any value to it.

True

True value is of type bool and we can not assign any value to it.

None

None is often used to represent absence of some value. None is of NoneType. We ca not assign any value to it.

NotImplemented

It is another constant which is used to indicate some operations are not implemented.

Ellipsis (...)

constant literal (...) is known as ellipsis which is used mostly in conjunction with extended slicing syntax for user-defined container data types.

__debug__

__debug__ is True if python was not started with an -O option otherwise False.