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

What is the output?

print(list(zip([1, 2, 3], 'ab')))
  1. [(1, 'a'), (2, 'b')]
  2. [(1, 'a'), (2, 'b'), (3, '')]
  3. [(1, 'ab'), (2, None)]
  4. Error
zip stops at the shortest input, so the trailing 3 is dropped.
Play Problem Solving ▸