W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
demo_python_tuple_add.py:
thistuple = ("apple", "banana", "cherry") thistuple[3] = "orange" # This will raise an error print(thistuple)
C:\Users\My Name>python demo_python_tuple_add.py
Traceback (most recent call last):
File "demo_tuple_add.py", line 2, in <module>
thistuple[3] = "orange" # This will raise an error
TypeError: 'tuple' object does not support item assignment