0

Both list have same size and element are int in both the list then why different size? I also read article where they told about the actual size of object inside list is different then the size of object itself. But here int is not an object referring to some instance.

>>> import sys
>>> from sys import getsizeof
>>> a = [1,2,3]
>>> b = [-ele for ele in a] 
>>> b
[-1, -2, -3]
>>> getsizeof(a)
80
>>> getsizeof(b) 
88
>>>
Himanshu Patel
  • 446
  • 4
  • 10

0 Answers0