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
Published on 22-Apr-2018 15:46:51
Advertisements