>>> import sys >>> sys.getsizeof('') 37 >>> sys.getsizeof('a') 38
可以看到, 空字符占用37个 byte, 长度为1的字符串 'a' 占内存 38个 byte. 多了一个字符 a 之后多了 1 个 byte。