Home »
MCQs »
Python MCQs
The for loop in Python is used to ___ over a sequence or other iterable objects
42. The for loop in Python is used to ___ over a sequence or other iterable objects.
- Jump
- Iterate
- Switch
- All of the mentioned above
Answer: B) Iterate
Explanation:
It is possible to iterate over a sequence or other iterable objects using the for loop in Python. The process of iterating over a sequence is referred to as traversal. Following syntax can be follow to use for loop in Python Program –
for val in sequence:
...
loop body
...
For loop does not require an indexing variable to set beforehand.