以更新模型为标准的类型分类-移远bc95常见问题

表4.7以更新模型为标准的类型分类更新模型分类Python类型可变类型列表,字典不可变类型数字、字符串、元组下面我们在上面的例子里加上id()调用,就会清楚的看到对象实际上已经被替换了: >>> x = 'Python numbers and strings' >>> print id(x) 16191392 >>> x = 'are immutable?!? What gives?' >>> print id(x) 16191232 >>> i = 0 >>> print id(i) 7749552 >>> i = i + 1 >>> print id(i)
pdf 文件大小:5.96MB