Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Python

In python when we use the Import sys V=7 print(sys.getsizeof(V)) Then why do we get the size as 28

26th Jun 2024, 5:39 AM
OO7 Manish kumar .M
OO7 Manish kumar .M - avatar
3 Answers
+ 2
OO7 Manish kumar .M Read this documentation of python you will get answer clearly. https://docs.python.org/3/library/sys.html#sys.getsizeof
26th Jun 2024, 6:03 AM
R๐Ÿ’ ๐Ÿ‡ฎ๐Ÿ‡ณ
R๐Ÿ’ ๐Ÿ‡ฎ๐Ÿ‡ณ - avatar
+ 2
OO7 Manish kumar .M , In first line of the code..., The value 7 is assigned to ...V getsizeof() is the function used to get the memory size in bytes of appropriate thing you mentioning...as here V... So, Memory size is 28 Value is 7... So it's the difference...
26th Jun 2024, 10:39 AM
Riya
Riya - avatar
0
But why 28 only means how.it is assigned
27th Jun 2024, 5:24 AM
OO7 Manish kumar .M
OO7 Manish kumar .M - avatar