ProgrammingHardTCS NQT · Accenture
What is printed?
What is printed?
print(min(['10', '9', '2']), min([10, 9, 2]))
- A. 9 2
- B. 10 2
- C. 2 2
- D. 10 9
Correct answer: B. 10 2
Strings compare character by character, so '10' is the smallest string. The integer minimum is 2.
More Python Programming questions
- What is printed? python s = {1, 2} t = s t |= {3} print(s, s is t)
- What is printed? python print(int(3.99), int(-3.99), round(3.5), round(4.5))
- What is printed? python print('ab' in ['ab', 'cd'], 'ab' in 'cdab', [] in [[]])
- What is printed? python x = [1, 2, 3] del x[::2] print(x)
- What is printed? python print(max(map(len, ['aa', 'b', 'ccc'])))
- What is printed? python print(bool(range(0)), bool(range(1)), bool({0: 0}))