Python Programming - Loops - Discussion

Discussion Forum : Loops - General Questions (Q.No. 17)
17.
What is the purpose of the enumerate function when used with a for loop?
Counts the total number of iterations.
Iterates over the values of a sequence.
Returns the index and value of each element in a sequence.
Reverses the order of iteration.
Answer: Option
Explanation:
The enumerate function is used in a for loop to iterate over both the index and value of each element in a sequence.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.