python tuple整理
来源:互联网 发布:java crm 源码 编辑:程序博客网 时间:2024/05/17 08:51
http://www.jb51.net/article/47986.htm
可变元组
>>> t = ('a', 'b', ['A', 'B'])>>> t[2][0] = 'X'>>> t[2][1] = 'Y'>>> t('a', 'b', ['X', 'Y'])
del 可删除元组
修改元组
#!/usr/bin/pythontup1 = (12, 34.56);tup2 = ('abc', 'xyz');# 以下修改元组元素操作是非法的。# tup1[0] = 100;# 创建一个新的元组tup3 = tup1 + tup2;print tup3;#以上实例输出结果:#(12, 34.56, 'abc', 'xyz')
内置函数
1、cmp(tuple1, tuple2):比较两个元组元素。
2、len(tuple):计算元组元素个数。
3、max(tuple):返回元组中元素最大值。
4、min(tuple):返回元组中元素最小值。
5、tuple(seq):将列表转换为元组。
0 0
- python tuple整理
- Python---tuple
- python tuple
- Python:tuple
- python--tuple
- Python tuple
- python tuple
- Python-tuple
- Python学习整理之 列表list 元组tuple 字典dictionary
- Python的tuple
- Python中的tuple
- Python 之 tuple
- Python list and tuple
- Python Tuple 详解
- 【python】-list,tuple,dict
- <python>string,list,tuple
- python tuple函数使用
- python immutable tuple list
- 单例模式
- img的src更改失败原因:JS文件放在了头部引入
- [c++]C++学习笔记001.cout/cin
- android 左上角返回上一级的实现
- Java NIO Channel
- python tuple整理
- OC字符串排序
- Partitioning by Palindromes uva111584
- 奇异值分解(SVD)的之低秩近似和特征降维
- JAVA5多线程---Condition使用---线程通信 --wait及notify方法
- PopupWindow
- MySQL(5.6)数据库索引
- 用python爬取游戏图片
- NLPIR2016分词的python3实现