$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · medium · #206

What is the output?

print(list(enumerate('ab', 1)))
  1. [(0, 'a'), (1, 'b')]
  2. [(1, 'a'), (2, 'b')]
  3. [('a', 1), ('b', 2)]
  4. [(1, 'b')]
The second argument sets the starting index, so counting begins at 1.
Play Problem Solving ▸