1、计算内存地址:

str1 = 'shn'

print id(str1)

2、计算内存大小,返回字节数

str1 = 'td'

print sys.getsizeof(str1)

3、