Python Programming - Conditional Statements - Discussion

Discussion Forum : Conditional Statements - General Questions (Q.No. 22)
22.
How can you iterate over both the index and the elements of a list in a for loop?
Using for i in range(len(my_list))
Using for element in my_list
Using for i, element in enumerate(my_list)
Using for i, element in range(len(my_list))
Answer: Option
Explanation:
The enumerate() function is used to iterate over both the index and the elements of a list in a for loop.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.