Why Numbers are 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: 2019-07-30T22:30:22+05:30

443 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements