I created two separate lists a
and b
with same element in two different ways. Why is there a difference between the size of the two lists?
import sys
a = [0]
print(a)
>>> [0]
print(sys.getsizeof(a))
>>> 72
b = [i for i in range(1)]
print(b)
>>> [0]
print(sys.getsizeof(b))
>>> 96