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']))
- A. 3 3 3
- B. 3 1 3
- C. 2 1 3
- 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
- What is printed? python print(float('1e2') == 100, int(float('1e2')), str(float('1e2')), int('100'))
- What is printed? python print(round(1.0000000000000002, 15) == 1, 1.0000000000000002 == 1, 1.0000000000000002 - 1 == 2.220446049250313e-16)
- What is printed? python s = 'hello world' print(s.title().split()[1][::-1], s.rsplit(' ', 1)[0], s.count('o', 5))
- What is printed? python print(int(0.1 10), round(0.1 10, 10) == 1, 0.1 10 == 1)
- What is printed? python print(abs(-0.0), abs(-3), abs(True), abs(-2 63))
- What is printed? python print(bool(0.0 or 0j), bool(0j or 1j), 0j == 0, 1j 1j)