What is the output of the following Python code snippet?
for i, c in enumerate('ab'):
print(c, i)
print(c, i)
Correct answer
C. a 0 b 1
C. a 0 b 1
enumerate() yields index and value pairs.
Asked in: Python Interview Control Flow
https://docs.python.org/3/tutorial/controlflow.htmlNot sure why the answer is C? Ask here and get an explanation.