Which of the following statements is used to execute a block of code repeatedly in Python?
Correct answer
D. while
17 views
D. while
17 views
The 'while' loop in Python is used to repeatedly execute a block of code as long as a specified condition evaluates to true. It is useful when the number of iterations is not known beforehand.
Not sure why the answer is D? Ask here and get an explanation.