在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/Python/ python多重賦值后沒(méi)有改變列表中的各項(xiàng)表項(xiàng)

python多重賦值后沒(méi)有改變列表中的各項(xiàng)表項(xiàng)

代碼如下:

student = ['c', 'c', 'c']
a, b, c = student
print(student)

運(yùn)行結(jié)果:
['c', 'c', 'c']

回答
編輯回答
離觴
>>> a, b, c =student

相當(dāng)于:

>>> a, b, c = student[0], student[1], student[2]
>>> a
'c'
>>> b
'c'
>>> c
'c'

student 本身不會(huì)發(fā)生變化。

2018年1月27日 10:07