ProgrammingModerateTCS NQT · Wipro pattern

What is printed?

What is printed?
print(max(map(len, ['a', 'bbb', 'cc'])), min(len(s) for s in ['a', 'bbb']), sum(len(s) for s in ['ab', 'c']))
  1. A. 3 3 3
  2. B. 3 1 3
  3. C. 2 1 3
  4. D. 3 1 2

Correct answer: B. 3 1 3

The longest word has three characters, and the shortest in the second list has one. The total length of ab and c is 3.

More Python Programming questions

Exams that ask this topic