08Python中的tupple数据类型
来源:互联网 发布:中国人 知乎 编辑:程序博客网 时间:2024/06/03 18:18
#-*- coding:UTF-8-*-# 1.Python的元组与列表类似,不同之处在于元组的元素不能修改。# 元组使用小括号,列表使用方括号。# 类似一个常量,元组提供了一种完整的约束。tup1 = (1,2,3,4,5)tup2 = ('1','2','3')print tup1[1:]print tup1[-1]print tup2# tup1[0] = 3 # 非法操作# 2.基本操作 # 删除元组tup3 = tup1 + tup2 # 创建一个新的元组print tup3del tup3print len(tup1)print tup1 * 2print 3 in tup1print max(tup1)print min(tup1)list1 = [1,2,3]tup1 = tuple(list1) # 将list转换为元组print tup1
阅读全文
0 0
- 08Python中的tupple数据类型
- 6.Scala中的Map和Tupple
- python 基础2 编码转换 pycharm 配置 运算符 基本数据类型int str list tupple dict for循环 enumerate序列方法 range和xrange
- 【python】python中的数据类型
- python 中的 数据类型
- python中的数据类型
- Python中的重要数据类型
- python中的数据类型
- python中的基本数据类型
- Python中的数据类型
- Python中的数据类型
- Python中的数据类型
- Python中的数据类型
- Python中的数据类型
- Python中的变量及数据类型
- python中的三大数据类型
- Python中的序列结构数据类型
- 05Python中的number数据类型
- <leetcode>637. Average of Levels in Binary Tree
- 【nginx+tomcat】轻松搭建高性能负载均衡集群
- 07Python中的list数据类型
- SSl2267 2013年全国信息学分区联赛普级组day1 货车运输(rmq)
- GBK字符集和UTF8字符集的转换C++
- 08Python中的tupple数据类型
- Java锁示例
- JAVA学习笔记——Comparable 接口
- C语言学习-调用自定义函数
- 判断二维坐标系中任意一个点是否在三角形内
- Pycharm快捷键
- 线段树学习笔记//日记
- Spring核心内容IOC和DI的理解
- 【LOJ】6007 「网络流 24 题」方格取数 网络流