What is the output of print(list(zip([1, 2], ['a']))) in Python?
print(list(zip([1, 2], ['a'])))
Correct answer
C. [(1, 'a')]
C. [(1, 'a')]
zip stops at the shortest iterable.
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.