当前位置:网站首页>python 循环区分(while循环和for循环)
python 循环区分(while循环和for循环)
2020-11-08 08:04:00 【osc_mfth2zpa】
适用性
while循环,适用于未知循环次数的循环;
for循环,适用于已知循环次数的循环;
详细解释
1、【循环次数基本可知】for适合遍历数据,数据遍历没有了就结束;
2、【循环次数基本不可知,通过判断条件的反条件来结束循环】while循环前,需要判断条件,相对适合逻辑比较复杂的循环;
备注:while循环和for循环,两者之间部分是可以切换的!!!
说明
1、本人第一次写CSDN博客,希望大家支持!
2、本人6年测试行业经验,3年黑盒测试经验,3年测试开发经验,曾任职国内大型人工智能上市公司,精通性能测试,自动化测试,接口测试,人工智能AI语音测试;
3、如下是本人内部沟通群,欢迎对于测试志同道合的人加入,大家一起沟通交流!
版权声明
本文为[osc_mfth2zpa]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/4419312/blog/4707857
边栏推荐
- 0.计算机简史
- Windows下子系统Ubuntu安装
- 你的主机中的软件中止了一个已建立的连接。解决方法
- Judging whether paths intersect or not by leetcode
- CPP (4) boost installation and basic use for Mac
- China Telecom announces 5g SA commercial scale in 2020
- 【原创】关于高版本poi autoSizeColumn方法异常的情况
- Distributed consensus mechanism
- IOS learning note 2 [problems and solutions encountered during the installation and use of cocopods] [update 20160725]
- Sum up some useful functions
猜你喜欢
面部识别:攻击类型和反欺骗技术
Android 9.0/P WebView 多进程使用的问题
Brief history of computer
Visual Studio 2015 未响应/已停止工作的问题解决
C++在C的基础上改进了哪些细节
归纳一些比较好用的函数
Template linked list learning
About the promotion of the whole stack of engineers, from the introduction to give up the secret arts, do not click in to have a look?
ts流中的pcr与pts计算与逆运算
Got timeout reading communication packets解决方法
随机推荐
Qt混合Python开发技术:Python介绍、混合过程和Demo
Using subprocess residue in supervisor and python multiprocessing
ubuntu实时显示cpu、内存占用率
C++基础知识篇:C++ 基本语法
Mouse small hand
IOS learning note 2 [problems and solutions encountered during the installation and use of cocopods] [update 20160725]
scala 中 Future 的简单使用
nvm
高并发,你真的理解透彻了吗?
你的主机中的软件中止了一个已建立的连接。解决方法
Game mathematical derivation AC code (high precision and low precision multiplication and division comparison) + 60 code (long long) + 20 point code (Full Permutation + deep search DFS)
搜索引擎的日常挑战_4_外部异构资源 - 知乎
What details does C + + improve on the basis of C
1.深入Istio:Sidecar自动注入如何实现的?
iOS 学习笔记二【cocopods安装使用和安装过程中遇到的问题及解决办法】【20160725更新】
leetcode之判断路径是否相交
Brief history of computer
Solve the problem of rabbitmq message loss and repeated consumption
Windows下子系统Ubuntu安装
[original] about the abnormal situation of high version poi autosizecolumn method