Why are numbers represented as objects in python?

PythonServer Side ProgrammingProgramming

Everything in Python is an object, and that includes the numbers. There are no "primitive" types, only built-in types.

Numbers, however, are immutable. When you perform an operation with a number, you are creating a new number object.

raja
Updated on 30-Jul-2019 22:30:22

Advertisements