mirror of https://github.com/TwoWater/Python
Signed-off-by: twowater <347073565@qq.com>
parent
281ef9ac31
commit
306de7f75a
|
@ -58,7 +58,22 @@ print(tuple2[0])
|
|||
|
||||
具体看下面的这个例子:
|
||||
|
||||

|
||||
```python
|
||||
#-*-coding:utf-8-*-
|
||||
list1=[123,456]
|
||||
tuple1=('两点水','twowater','liangdianshui',list1)
|
||||
print(tuple1)
|
||||
list1[0]=789
|
||||
list1[1]=100
|
||||
print(tuple1)
|
||||
```
|
||||
|
||||
输出的结果:
|
||||
```
|
||||
('两点水', 'twowater', 'liangdianshui', [123, 456])
|
||||
('两点水', 'twowater', 'liangdianshui', [789, 100])
|
||||
```
|
||||
|
||||
|
||||
可以看到,两次输出的 tuple 值是变了的。我们看看 tuple1 的存储是怎样的。
|
||||
|
||||
|
|
Loading…
Reference in New Issue