Q7-What is the primary purpose of a while loop in Python?
A. To define a function.
B. To create an infinite loop.
C. To iterate over a sequence of elements.
D. To repeatedly execute a block of code as long as a condition is true.
This question is part of this quiz :
Conditionals and Flow Control