ProgrammingModerateTCS CodeVita · Infosys HackWithInfy
What is printed?
What is printed?
print('abc' < 'abcd', 'Z' < 'a', '10' < '9')- A. False True True
- B. True True False
- C. True True True
- D. True False True
Correct answer: C. True True True
A prefix is smaller than the longer string. Uppercase Z (90) is below lowercase a (97). '1' comes before '9', so '10' is less than '9'.
More Python Programming questions
- What is printed? python i = 0 while (i := i + 1) < 4: pass print(i)
- What is printed? python print(float('nan') < 0, float('inf') > 10 300, -float('inf') < -10 300)
- What is printed? python print(10 309 > float('inf'), end=' ') try: float(10 309) except OverflowError as e: print(e)
- What is printed? python from collections import Counter d = {'a': 1, 'b': 2} v = d.values() d['c'] = 3 print(len(v), list(v))
- What is printed? python print(frozenset([1, 2]) == {1, 2}, {frozenset([1]): 'x'}[frozenset([1])])
- What is printed? python a = [1, 2, 3] r = a.reverse() print(r, a)