Python自学之collection
来源:互联网 发布:iphone7plus在线软件 编辑:程序博客网 时间:2024/05/01 10:23
# 定义数组x = [31.8, 33.9, 35.0, 33.9, 33.8, 33.0, 33.0, 34.4, 36.5, 38.0, 39.3, 40.7, 41.7, 41.4, 40.7, 39.9]# 数组遍历for a in x: print (a) # 数组遍历for i in range(0, len(x)): print (i, x[i]) #mapinformation=['liusen',25]print(information[1]+1)#负数表示从另一边查找print(x[-1])print(x[3:-3])print(x[3:-3:2])x=[1,2,3]y=[4,5,6]print(x+y)s=[1]*12print(s)print(len(s))m='python'*5print(m)
实验结果:
31.833.935.033.933.833.033.034.436.538.039.340.741.741.440.739.90 31.81 33.92 35.03 33.94 33.85 33.06 33.07 34.48 36.59 38.010 39.311 40.712 41.713 41.414 40.715 39.92639.9[33.9, 33.8, 33.0, 33.0, 34.4, 36.5, 38.0, 39.3, 40.7, 41.7][33.9, 33.0, 34.4, 38.0, 40.7][1, 2, 3, 4, 5, 6][1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]12pythonpythonpythonpythonpython
0 0
- Python自学之collection
- python自学之异常
- python自学之文件
- python自学之字典
- 自学Python之变量
- 自学Python之函数
- Python自学之计算
- Python自学之String
- 自学python之路
- Python高级数据结构之Collection
- 自学python之猜数字。。。
- 自学Python之遍历字典
- 自学Python之 基础语法
- python自学之路-01
- python自学之路-02
- python自学之路-03
- python自学之路-04
- python自学之路-05
- Python自学之String
- Pojo
- 在navicat for mysql中建立触发器
- 观察者模式
- 在lua中常用到的几个小函数
- Python自学之collection
- 帧速度的控制
- flash外部引入视频
- bzoj1635 最高的牛
- Yii的增删改查-分页
- D类功放设计
- C#CAD二次开发图案填充对象边界提取
- laraver的增删改查-分页
- 计算缓存大小并且清空缓存