1、元组一旦定义不能修改
2、可以定义空元组
empty_tuple = ()
3、元组中只有一个数据时末尾要加英文逗号
single_tuple = (6,)
4、元组取值和取索引

5、统计计数 count方法统计包含元素的个数

6、统计元组中包含的元素个数 len

7、元组的遍历

1、元组一旦定义不能修改
2、可以定义空元组
empty_tuple = ()
3、元组中只有一个数据时末尾要加英文逗号
single_tuple = (6,)
4、元组取值和取索引
5、统计计数 count方法统计包含元素的个数
6、统计元组中包含的元素个数 len
7、元组的遍历
本文标题:Python中元组tuple详细解析
本文链接:https://www.haomeiwen.com/subject/zxvxrctx.html
网友评论