博客
关于我
python学习day10(元组)
阅读量:386 次
发布时间:2019-03-04

本文共 810 字,大约阅读时间需要 2 分钟。

??

?.???????

??????????????????????????????????????????????????????????????????????????????????????????????????????????

?.????

??????????????????????????????????????????????????????????????????????????????????????????????????????????????

???

??????t1=(10,20,30)

???t2=(10)?????????????????????????????

?.???????

??????????????????????????????????????????????????

?1????????

t1=(10,20,30)print(t1[0])  # ??10

?2?index???????????????

tuple=('aa','bb','cc','bb')print(tuple.index('aa'))  # ??0

?3?count????????????????

tuple=('aa','bb','cc','bb')print(tuple.count('aa'))  # ??1

?4?len??????????????

tuple=('aa','bb','cc','bb')print(len(tuple))  # ??4

???????

?????????????????????????????????????????????????????????????????

tuple=('aa','bb','cc',['dd'])tuple[3][0]='tom'print(tuple)  # ??('aa','bb','cc',['tom'])

转载地址:http://asfg.baihongyu.com/

你可能感兴趣的文章
NPOI将某个程序段耗时插入Excel
查看>>
NPOI格式设置
查看>>
NPOI设置单元格格式
查看>>
Npp删除选中行的Macro录制方式
查看>>
NR,NF,FNR
查看>>
nrf24l01+arduino
查看>>
nrf开发笔记一开发软件
查看>>
nrm —— 快速切换 NPM 源 (附带测速功能)
查看>>
nrm报错 [ERR_INVALID_ARG_TYPE]
查看>>
NS3 IP首部校验和
查看>>
NSDateFormatter的替代方法
查看>>
NSError 的使用方法
查看>>
NSGA-Ⅲ源代码
查看>>
nsis 安装脚本示例(转)
查看>>
NSJSON的用法(oc系统自带的解析方法)
查看>>
nslookup 的基本知识与命令详解
查看>>
NSNumber与NSInteger的区别 -bei
查看>>
NSOperation基本操作
查看>>
NSRange 范围
查看>>
NSSet集合 无序的 不能重复的
查看>>