Snehal patel has Published 1 Articles

Why are numbers represented as objects in python?

snehal patel

snehal patel

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

305 Views

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.

1
Advertisements