当前位置:网站首页>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
边栏推荐
- Judging whether paths intersect or not by leetcode
- A compilation bug brought by vs2015 Update1 update [existing solutions]
- Face recognition: attack types and anti spoofing techniques
- 面部识别:攻击类型和反欺骗技术
- The software in your host has terminated an established connection. resolvent
- Wechat applet request reported 400 error @ requestbody failed to receive
- Adobe Prelude / PL 2020 software installation package (with installation tutorial)
- IOS learning note 2 [problems and solutions encountered during the installation and use of cocopods] [update 20160725]
- The most detailed usage guide for perconaxtradbcluster8.0
- Basic operation of database
猜你喜欢
云计算之路-出海记:整一台 aws 免费云服务器
Judging whether paths intersect or not by leetcode
Face recognition: attack types and anti spoofing techniques
Data structure and sorting algorithm
Unparseable date: 'Mon Aug 15 11:24:39 CST 2016',时间格式转换异常
面部识别:攻击类型和反欺骗技术
FORTRAN 77 reads some data from the file and uses the heron iteration formula to solve the problem
These core technology of object-oriented, after you master it, you can have a good interview
C language I blog assignment 03
China Telecom announces 5g SA commercial scale in 2020
随机推荐
iOS上传App Store报错:this action cannot be completed -22421 解决方案
VC6 compatibility and open file crash resolution
C语言I博客作业03
Face recognition: attack types and anti spoofing techniques
接口
归纳一些比较好用的函数
Face recognition: attack types and anti spoofing techniques
分布式共识机制
Summary of knowledge points of Jingtao project
Visual studio 2015 unresponsive / stopped working problem resolution
leetcode之判断路径是否相交
Blazor 准备好为企业服务了吗?
Ladongo open source full platform penetration scanner framework
wanxin金融
模板链表类学习
Abnormal + Abstract
Distributed consensus mechanism
【原创】关于高版本poi autoSizeColumn方法异常的情况
双向LSTM在时间序列异常值检测的应用
These core technology of object-oriented, after you master it, you can have a good interview