元组(tuple)是不可更改的(list)
元组定义
temp=(1)
#此时temp的类型为int
temp=(1,)
#此时temp的类型为tuple
temp=1,
#此时temp的类型也为tuple
对元组进行修改就需要利用切片的特性
temp=(1,2,3,5)
temp = temp[:2]+(4,)+temp[2:]
temp=(1)
#此时temp的类型为int
temp=(1,)
#此时temp的类型为tuple
temp=1,
#此时temp的类型也为tuple