ProgrammingHardTCS NQT · Wipro pattern
What is printed?
What is printed?
print('aaa' < 'b', 'abc' > 'abd')- A. True True
- B. False False
- C. False True
- D. True False
Correct answer: D. True False
Strings compare character by character, and a in aaa is smaller than b. abc is smaller than abd because c comes before d.
More Python Programming questions
- What is printed? python print(sum(1 for c in 'hello world' if c in 'aeiou'))
- What is printed? python print(list(filter(lambda x: x > 0, map(lambda x: x - 2, [1, 2, 3, 4]))))
- What is printed? python print(1e3, 1000.0 == 1e3, 10 -2)
- What is printed? python print(type(True + 1).name, type(2 1.0).name)
- What is printed? python print(list(enumerate(['x'], 1))[0][0] + 1)
- What is printed? python print(list('ab') == ['a', 'b'], 'ab' == ['a', 'b'])