Can anyone please describe about for loop in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone please describe about for loop in python?

Loops - While

11th Jun 2021, 1:02 PM
Kal
Kal - avatar
2 Answers
+ 2
Hi Kal, Welcome in Sololearn, while loopĀ is a control flowĀ statementĀ that allows code to be executed repeatedly based on a given Boolean condition. TheĀ while loopĀ can be thought of as a repeating ifĀ statement. For eg, if you wanna print "Hello Words" five times then you can use the help of loop for eg - https://code.sololearn.com/cNOD9z8h5EM2/?ref=app You can do it 100times , 400times. if condition is always True then it will blast your computer. just kidding nothing to worry! If the condition is always true in a loop is known as infinite loop As you are new, read the guidelines -!https://www.sololearn.com/Discuss/1316935/?ref=app Enjoy Sololeaening, šŸ™‚
11th Jun 2021, 1:06 PM
Abhiyantā
Abhiyantā - avatar
+ 2
In Python, While loop is used to execute a block of statements repeatedly until a given condition is satisfied. And when the condition becomes false, the line immediately after the loop in the program is executed. https://www.w3schools.com/python/python_while_loops.asp https://www.sololearn.com/learn/Python/2281/?ref=app
11th Jun 2021, 1:44 PM
Scarlet Witch
Scarlet Witch - avatar