当前位置:网站首页>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
边栏推荐
- C language I blog assignment 03
- C语言I博客作业03
- 哔哩哔哩常用api
- Learn Scala if Else statement
- 5G+AR出圈,中国移动咪咕成第33届中国电影金鸡奖全程战略合作伙伴
- Qt混合Python开发技术:Python介绍、混合过程和Demo
- Solve the problem of rabbitmq message loss and repeated consumption
- What details does C + + improve on the basis of C
- Basic knowledge of C + +
- C expression tree (1)
猜你喜欢
2020天翼智能生态博览会中国电信宣布5G SA正式规模商用
The most detailed usage guide for perconaxtradbcluster8.0
On the stock trading of leetcode
5G+AR出圈,中国移动咪咕成第33届中国电影金鸡奖全程战略合作伙伴
面部识别:攻击类型和反欺骗技术
Oschina plays on Sunday - before that, I always thought I was a
Privacy violation and null dereference of fortify vulnerability
1. In depth istio: how is sidecar auto injection realized?
C expression tree (1)
什么你的电脑太渣?这几招包你搞定! (Win10优化教程)
随机推荐
模板链表类学习
swiper 窗口宽度变化,页面宽度高度变化 导致自动滑动 解决方案
Solve the problem of rabbitmq message loss and repeated consumption
数据科学面试应关注的6个要点
C++基础知识篇:C++ 基本语法
QT hybrid Python development technology: Python introduction, hybrid process and demo
微信昵称emoji表情,特殊表情导致列表不显示,导出EXCEL报错等问题解决!
The real-time display of CPU and memory utilization rate by Ubuntu
Unparseable date: 'mon Aug 15 11:24:39 CST 2016', time format conversion exception
More than 50 object detection datasets from different industries
Is blazor ready to serve the enterprise?
What? Your computer is too bad? You can handle these moves! (win10 optimization tutorial)
Oschina plays on Sunday - before that, I always thought I was a
Mouse small hand
Face recognition: attack types and anti spoofing techniques
Web Security (3) -- CSRF attack
Littlest jupyterhub| 02 using nbgitpuller to distribute shared files
scala 中 Future 的简单使用
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)
PerconaXtraDBCluster8.0 最详尽用法指南