Chapter 2 - Memory & Data Types

example 2.1, page no. 54

In [1]:
import sys 

print "Size of Integer is: " + str(sys.getsizeof(int()))
print "Size of Float is: " + str(sys.getsizeof(float()))
print "Size of Long is: " + str(sys.getsizeof(long()))
print "Size of String is: " + str(sys.getsizeof(str()))
Size of Integer is: 24
Size of Float is: 24
Size of Long is: 24
Size of String is: 37