元组的一级元素不可修改
#元组,有序
tu = (111,"alex",(11,22),[(33,44)],True,33,44,)
v = tu[3][0][0] print(v) #输出结果 :33 v1 = tu[3] print(v1) #输出结果:[(33, 44)] tu[3][0] = 567 print(tu) #输出结果:(111, 'alex', (11, 22), [567], True, 33, 44)
tu = (111,"alex",(11,22),[(33,44)],True,33,44,)
v = tu[3][0][0] print(v) #输出结果 :33 v1 = tu[3] print(v1) #输出结果:[(33, 44)] tu[3][0] = 567 print(tu) #输出结果:(111, 'alex', (11, 22), [567], True, 33, 44)
转载于:https://www.cnblogs.com/kangming-/p/9853635.html