主页
Python
Python - 更新元组
demo_tuple_add_orange
运行 ❯
×
更改方向
保存代码
更改主题
thistuple = ("apple", "banana", "cherry") y = list(thistuple) y.append("orange") thistuple = tuple(y) print(thistuple)
('apple', 'banana', 'cherry', 'orange')