python 作为一个发展中的语言,也提供了其他的一些数据类型。
tuple也是 python 中一个标准的序列类型。
tuple
他的一些操作和str和list是通用的,因为他们都是一种序列(sequence data type)
str
list
sequence data type
支持索引、切片、连接,支持使用内置len()来获取tuple中元素的个数。
len()
另外tuple是不可变对象,所以不能对tuple做修改。