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

What is printed?

print(list(zip([1, 2, 3], [4, 5])))
  1. [(1, 4), (2, 5)]
  2. [(1, 4), (2, 5), (3, None)]
  3. [(1, 2, 3), (4, 5)]
  4. [1, 4, 2, 5]
zip stops at the shortest iterable and drops the leftover.
Play Problem Solving ▸