Something I thought was super interesting
# %%
from array import array
list_of_1_million_signed_ints = list(range(0, 10**6))
array_of_1_million_signed_ints = array("I", list_of_1_million_signed_ints)
print(f"size of list in mb {list_of_1_million_signed_ints.__sizeof__() / 2**20:.2f}MiB")
print(f"size of array in mb {array_of_1_million_signed_ints.__sizeof__() / 2**20:.2f}MiB")
"""
expected output
size of list in mb 7.63MiB
size of array in mb 3.81MiB
Using 10**9
size of list in gb 7.45GiB
size of array in gb 3.73GiB
"""