+ 5
What is while loop?
I'm not understanding while loop . I think it's complicated . I 'm also new to programming and python but I've tried c .
5 Answers
+ 12
The while loop is used to repeat a section of code an unknown number of times until a specific condition is met. For example, say we want to know how many times a given number can be divided by 2 before it is less than or equal to 1. If we know a specific number, such as 32, we can say 5 times, but for a given symbolic variable "NUMBER" which represents any number in the world, how many times is notknown a priori (before hand).Â
more details : http://www.cs.utah.edu/~germain/PPS/Topics/while_loops.html
+ 5
you can think about them as if statements its like present and present progressive in grammar :
if you expect your if expressions to change , you use a while loop to make sure your lines runs only when a certain condition is satisfied or only when a certain condition is not present .
+ 3
thank you
+ 2
thank you