Home Page
About Us


Loops are a type of control flow structure in programming in which a series of statements may be executed repeatedly until some condition is met.


A while loop is a control structure used in many programming languages to continuously execute a set of instructions as long as a particular condition is met.



Also a user-prompt loops is better implemented with a while-loop to avoid adding a frame to your call-stack everytime the user enters a wrong input

from question  

Simple Yes or No Loop Python3

You use a for-loop for an unknown number of loops iterations;this is not wrong but a while-loop is more appropriate

from question  

Java Strings Loops Arrays Null

If the condition in the while-loop is not met loops never executes;a do-while loops works almost the same way except the condition is evaluated after execution of loops hence loops always executes at least once

from question  

Modify while loop to execute at-least once

If you re just going to loops through point use a for-loop as while-loop is more prone to dropping into an endless loops if you forgot to increment counter or doing wrongly or do it in multiple places

from question  

Android - How to overlay one path on top of another

Back to Home
Data comes from Stack Exchange with CC-BY-SA-4.0