range
来源:互联网 发布:python中字符串的函数 编辑:程序博客网 时间:2024/06/05 14:12
range([start,] stop [, step])
start
The value of the start parameter (or
0
if the parameter was not supplied)
stop
The value of the stop parameter
step
The value of the step parameter (or
1
if the parameter was not supplied)
>>> list(range(5))
[0, 1, 2, 3, 4]
>>> list(range(1,5))
[1, 2, 3, 4]
>>> list(range(1,5))
[1, 2, 3, 4]
>>> list(range(1,10,2))
[1, 3, 5, 7, 9]
>>> list(range(1,10,3))
[1, 4, 7]
[1, 3, 5, 7, 9]
>>> list(range(1,10,3))
[1, 4, 7]
>>> list(range(5,0,-1))
[5, 4, 3, 2, 1]
[5, 4, 3, 2, 1]
阅读全文
0 0
- Range
- Range
- range
- range()
- Range
- range
- Range
- Range
- Range
- range
- range
- range和content-range
- time-range
- python--range()
- HTTP Range
- Range Name
- USACO--range
- Dynamic Range
- Spring Aop 初探(1)
- Codeforces
- Linux man
- Java开发环境配置-讲解
- android进阶:利用rxjava写一个超简单的bus
- range
- Ubuntu用户及用户组管理命令
- 按每天特定时间作为分界来统计数据的sql语句[sqlserver]
- 2017.7.5工作日记
- Vue中render方法的使用
- Java实例成员和静态成员的理解
- unity学习之飞机大战制作 关键点(三) 设置子弹的生成和移动
- POJ 2815 Context-Free Clock 笔记
- 指针数组和数组指针