how to check memory of variable in python code example
Example: python how much memory does a variable need
from sys import getsizeof
a = 42
getsizeof(a) # size of object in bytes
from sys import getsizeof
a = 42
getsizeof(a) # size of object in bytes