元组
定义: T=(). 逗号分隔元素, 元素可以是任意类型
age=(11,22,33,44,55,33)
#本质 age=tuple((11,22,33,44,55,33))
1 age=(11,22,33,44,55,33) 2 print(age[2])
>>> 33 3 print(age[1:4])
>>> (22, 33, 44) 4 print(len(age))
>>> 6
1 age=(11,22,33,44,55,33) 2 print(11 in age)
>>> True
1 age=(11,22,33,44,55,33) 2 print(age.index(22))
>>> 1 3 print(age.count(33))
>>> 2