tuple and list
tuple 中包含list list 可以更改
The value of some objects can change. Objects whose value can change are said to be mutable; objects whose value is unchangeable once they are created are called immutable. (The value of an immutable container object that contains a reference to a mutable object can change when the latter’s value is changed; however the container is still considered immutable, because the collection of objects it contains cannot be changed. So, immutability is not strictly the same as having an unchangeable value, it is more subtle.) An object’s mutability is determined by its type; for instance, numbers, strings and tuples are immutable, while dictionaries and lists are mutable.
tuple1 = (1,2,) tuple1.append(11) tuple1 (1, 2, )
本文由 ares 创作.
最后编辑时间为: Aug 26, 2019 at 01:16 am