1. Home
  2. Data Science
  3. Python
  4. What does enumerate(['a', 'b'], start=1) yield?

Added 2 Nov 2026

What does enumerate(['a', 'b'], start=1) yield?

  1. (0, 'a') and (1, 'b')
  2. (1, 'a') and (2, 'b') Correct answer
  3. (1, 'b') and (2, 'a')
  4. ('a', 1) and ('b', 2)

Correct answer

B. (1, 'a') and (2, 'b')

18 views

MCQSEXAM

Explanation

enumerate pairs a counter with each item, so for i, item in enumerate(...) replaces manual index tracking. The start parameter sets the first number.

Reference

Asked in: NTS, Python Developer Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs