当前位置:网站首页>Python loop distinction (while loop and for loop)

Python loop distinction (while loop and for loop)

2020-11-08 08:04:00 osc_mfth2zpa

Applicability
while loop , For cycles with unknown number of cycles ;
for loop , For cycles with known number of cycles ;

Explain in detail
1、【 The number of cycles is basically known 】for Suitable for traversing data , The data traversal ends when there is no data ;
2、【 The number of cycles is basically unknown , End the loop by judging the inverse of the condition 】while Before circulation , We need to judge the conditions , It is relatively suitable for loops with complicated logic ;

remarks :while Circulation and for loop , Part of it can be switched between the two !!!

explain
1、 I wrote... For the first time CSDN Blog , I hope you all support !
2、 I am 6 Years of testing industry experience ,3 Years of black box testing experience ,3 Years of test development experience , He once worked in a large-scale artificial intelligence listed company in China , Proficient in performance testing , automated testing , The interface test , Artificial intelligence AI Voice test ;
3、 The following is my internal communication group , You are welcome to join us , Let's communicate together !
 Insert picture description here



版权声明
本文为[osc_mfth2zpa]所创,转载请带上原文链接,感谢