What is the use of while ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the use of while ?

21st Aug 2019, 12:31 AM
Abhigyan Pandey
Abhigyan Pandey - avatar
4 Answers
+ 3
To repeat some statements as long as a condition is satisfied.
21st Aug 2019, 2:00 AM
Sonic
Sonic - avatar
+ 2
If you are asking the use of while loop in Python,click the link. You should make sure that the condition of the while loop will become false eventually or else it eill be an infinite loop. https://www.sololearn.com/discuss/1937527/?ref=app
21st Aug 2019, 1:40 AM
Ketchup🍅
Ketchup🍅 - avatar
0
Almost same like for loop. Do something repeatly as long as condition is true.
21st Aug 2019, 4:11 AM
Patryk Dolata
Patryk Dolata - avatar
0
a “do while” loop is a sort of while loop, but executes at least once. the condition are checked at the end of the loop, not before like a while or for loop. not all languages have a do while loop
21st Aug 2019, 7:58 AM
Brave Tea
Brave Tea - avatar