four components of a loop
Answers
Answered by
5
Answer: Loop statements usually have four components: initialization (usually of a loop control variable), continuation test on whether to do another iteration, an update step, and a loop body.
HOPE YOU GOT THE ANSWER
Answered by
0
Loop:
- Looping reduces the difficulty of complex problems to a manageable level.
- It allows us to change the program's flow so that instead of writing the same code over and over, we can repeat it a limited amount of times.
The four elements of a Python while loop are as follows:
(i) Initialization expressions I initialization expressions (ii) initialization expressions (starting)
(ii) Put your expression to the test (reporting or stopping)
(iii) the loop's main body (doing)
(iv) change the expression (changing)
Similar questions
English,
4 months ago
Science,
4 months ago
Math,
9 months ago
Computer Science,
9 months ago
Computer Science,
1 year ago