0
While Loops - Up until this point everything made sense. The explanation and the examples I'll learn elsewhere
While Loops
2 Answers
+ 1
Hi! You forgot the question mark. What about while loops? You donât understand how they works, or what?
While loops loops as long as the condition in the while statments head is true. Then the lines in the while statments body executes. When the condition in the while statments head becomes false, the loops stop to excecute the line in its body.
So the idea is to have some code lines in the body that affects the while statments condition.
There is also a possibility to break the loop with the key word break inside the while statmwnts body.
while < head >:
< body
âŠ.
âŠ.
âŠ. >
0
Sorry about that. The explanation and example was confusing in the lesson.
The print function has always come at the end.
The question to arrange the lines of code had it on the third line instead of the fourth line.
The mathematics is also confusing in the lessons.