how to find memory size allocated to the variables 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