+ 2

What is the size of variable in python

i am learning python please help me what is the size of the variables in python, while learning java i learnt variables have size why not in python any one help me.

21st Jun 2018, 6:48 AM
Thelukutla Lokesh
Thelukutla Lokesh - avatar
2 odpowiedzi
+ 3
Variable size refer to how much memory its necessary to hold it. In languages that hold native format size, the size depends from compiler/OS. Python dont store type like native one, it wrap they for make they more manageable for itself... You can know size with sys.getsizeof but remember that on different platforms/interpreters can return different values then dont make assumption about it
21st Jun 2018, 7:07 AM
KrOW
KrOW - avatar
+ 1
variables does't have any size there sizes depends on their data types
21st Jun 2018, 6:58 AM
Adarsh.n. Bidari
Adarsh.n. Bidari - avatar