+ 1
Why why we say that in python an int or float variables are objects???
I agree that when we create lists or Tuples or even dictionaries we are creating an objects of these data structures Because they are already built in python Which means we are creating objects . But I canât understands that floats and int variables are objects Normally they are called primitive data types
4 Answers
+ 2
Because they are objects of a class. You can try it with print(type(1)) as an example, and you get that 1 is of class int.
+ 1
they are primitive wrapped in object ;)
+ 1
There are a class in python called int and there are a class called float so we create object from int or float classes.