Why are numbers represented as objects in python?


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.

Updated on: 30-Jul-2019

300 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements