当前位置:网站首页>range函数作用
range函数作用
2022-08-05 05:13:00 【长路漫漫 大佬为伴】
参考:range函数作用
range(n)是产生0~n-1的数,range(5)=range(0, 5)
range函数产生的不是一个列表,所以需要依次输出或者使用list函数输出整个列表
>>>range(5)
range(0, 5)
>>> for i in range(5):
... print(i)
...
0
1
2
3
4
>>> list(range(5))
[0, 1, 2, 3, 4]
>>> list(range(0))
[]
边栏推荐
- "Recursion" recursion concept and typical examples
- Structured Light 3D Reconstruction (2) Line Structured Light 3D Reconstruction
- 重新审视分布式系统:永远不会有完美的一致性方案……
- 位运算符与逻辑运算符的区别
- "PHP8 Beginner's Guide" A brief introduction to PHP
- span标签和p标签的区别
- jvm 三 之堆与栈
- Requests the library deployment and common function
- Flutter真机运行及模拟器运行
- LAB Semaphore Implementation Details
猜你喜欢
随机推荐
数字_获取指定位数的小数
C#关于set()和get()方法的理解及使用
【过一下8】全连接神经网络 视频 笔记
for..in和for..of的区别
RDD和DataFrame和Dataset
数据库 单表查询
1068找到更多的硬币
shell函数
Returned object not currently part of this pool
Redis - 13、开发规范
redis 持久化
The difference between span tag and p
LeetCode:1403. 非递增顺序的最小子序列【贪心】
"PHP8 Beginner's Guide" A brief introduction to PHP
Error creating bean with name ‘configDataContextRefresher‘ defined in class path resource
Flutter学习5-集成-打包-发布
HQL语句执行过程
u-boot in u-boot, dm-pre-reloc
2022 Hangzhou Electric Multi-School 1st Session 01
【学习笔记之菜Dog学C】动态内存管理之经典笔试题



![coppercam primer [6]](/img/d3/a7d44aa19acfb18c5a8cacdc8176e9.png)




