ProgrammingModerateTCS NQT · Wipro pattern
What is printed?
What is printed?
print(max(3, 3.5, 2), min('b', 'a', 'c'), max([1, 2], [1, 3]))- A. 3 a [1, 3]
- B. 3.5 a [1, 2]
- C. 3.5 a [1, 3]
- D. 3.5 c [1, 3]
Correct answer: C. 3.5 a [1, 3]
3.5 is the largest number. min of letters is the smallest, a, and lists compare element by element, so [1, 3] beats [1, 2].
More Python Programming questions
- What is printed? python print(len(str(9 20)), str(9 20)[0], sum(map(int, str(9 20))) % 9)
- What is printed? python from fractions import Fraction print(Fraction('1.5'), Fraction('3/6'), float(Fraction('1/3')) == 1/3…
- What is printed? python print(sum([[1, 2], [3]], []), ''.join(['ab', 'c']), [x for x in 'hey'][::2])
- What is printed? python print('%o' % 8 == oct(8)[2:], '%x' % 255 == hex(255)[2:], bin(5)[2:].zfill(4))
- What is printed? python print(-1 2, (-1) 2, -1 -1, (-1) -1)
- What is printed? python print(divmod(-9, 4), divmod(9, -4), -9 % 4, 9 % -4)