如果只是用‘+’将两个元祖相加,只会将第2个元祖加到第一个元祖之后。

tuple1 = (1,2,3)
tuple2 = (4,5,6)
tuple1+tuple2

#输出(1, 2, 3, 4, 5, 6)

要实现对应元素想加,要借用到map函数

tuple1 = (1,2,3)
tuple2 = (4,5,6)
zipped = zip(tuple1,tuple2)
mapped = map(sum,zipped)
tuple(mapped)

#输出(5,7,9)