当前位置:网站首页>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))
[]
边栏推荐
猜你喜欢
MySQL Foundation (1) - Basic Cognition and Operation
coppercam入门手册[6]
Dephi逆向工具Dede导出函数名MAP导入到IDA中
Flex layout frog game clearance strategy
"Recursion" recursion concept and typical examples
MySQL基础(一)---基础认知及操作
Day019 Method overriding and introduction of related classes
How can Flutter parent and child components receive click events
Flutter学习5-集成-打包-发布
【过一下8】全连接神经网络 视频 笔记
随机推荐
【解码工具】Bitcoin的一些在线工具
LAB Semaphore Implementation Details
ESP32 485 Illuminance
[Nine Lectures on Backpacks - 01 Backpack Problems]
Detailed Explanation of Redis Sentinel Mode Configuration File
『递归』递归概念与典型实例
社区分享|腾讯海外游戏基于JumpServer构建游戏安全运营能力
uva1325
Transformation 和 Action 常用算子
Returned object not currently part of this pool
UVA10827
Mysql5.7 二进制 部署
Excel画图
Algorithms - ones and zeros (Kotlin)
分布式和集群
flex布局青蛙游戏通关攻略
OFDM 十六讲 5 -Discrete Convolution, ISI and ICI on DMT/OFDM Systems
Flutter学习5-集成-打包-发布
human weakness
[WeChat applet] WXML template syntax - conditional rendering