Q. What does the `enumerate()` function do?

  • (A) Counts the elements in a list
  • (B) Returns index and value pairs from an iterable
  • (C) Sorts the elements
  • (D) Removes duplicates
πŸ’¬ Discuss
βœ… Correct Answer: (B) Returns index and value pairs from an iterable
Explanation: `enumerate()` returns both index and item while looping through an iterable.
Explanation by: Mr. Dubey
`enumerate()` returns both index and item while looping through an iterable.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
66
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
84%
Success Rate