📜  将值添加到元组 python 代码示例

📅  最后修改于: 2022-03-11 14:45:22.922000             🧑  作者: Mango

代码示例1
# just add a comma (,) after the value you want to add to the tuple.
my_tuple = (1,2,3,4,5)
my_tuple += 6,
my_tuple += 'hi',
print(my_tuple)

>>> (1, 2, 3, 4, 5, 6, 'hi')