ProgrammingModerateTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(list(map(lambda p: p[0] + p[1], zip([1, 2], [10, 20, 30]))))
  1. A. [11, 22, 30]
  2. B. [11, 22, 33]
  3. C. [1, 2, 10, 20]
  4. D. [11, 22]

Correct answer: D. [11, 22]

zip stops at the shorter list, so only two pairs are formed: (1, 10) and (2, 20).

More Python Programming questions

Exams that ask this topic