A ____ loop is used to iterate a block of code a specified number of times.
- do-while
- for
- repeat
- while
In Python, a for loop is commonly used to iterate over a sequence (such as a list) a specified number of times. The for loop iterates over the elements of the sequence, executing the block of code for each element.
Loading...
Related Quiz
- What could be a practical scenario where the pass statement becomes essential, especially in function definitions?
- Which method is commonly used to send data from a web form to a Python back-end?
- To loop through two lists simultaneously, one can use the _______ function in conjunction with a for loop.
- Which algorithm would you use to find the shortest path in an unweighted graph?
- A function in Python can return multiple values using a _______.