Let's suppose that I want to know how much the variables on a program is using
s1 = "a long string"
s2 = "another long string"
I want to know if it possible to know the usage of RAM of both strings, is there a way?
Let's suppose that I want to know how much the variables on a program is using
s1 = "a long string"
s2 = "another long string"
I want to know if it possible to know the usage of RAM of both strings, is there a way?
I think sys.getsizeof
will solve your problem. It will show size of your variable
from sys import getsizeof
data = "abcdefghij"
print(getsizeof(data))