ProgrammingHardProduct-company MCQ pattern
What is printed?
What is printed?
print(max('zebra', 'Zebra'), min('a', 'B'), sorted('bA', key=ord)[0], 'bA' > 'Ab')- A. zebra B A False
- B. zebras B A True
- C. zebra B A True
- D. zebra B B True
Correct answer: C. zebra B A True
Lowercase letters have higher code points, so 'zebra' beats 'Zebra' in max. min picks 'B' because uppercase B is 66 while 'a' is 97, and sorting by ord puts 'A' first.
More Python Programming questions
- What is printed? python print([1, 2] < [1, 2, 0], [1, 2] < [1, 3, 0], (1, 2) < (1, 2, 0), 'ab' < 'abc')
- What is printed? python print(hex(255), hex(-255), oct(-8), bin(0), int('-ff', 16), int('0xFF', 0))
- What is printed? python print(int('8' 3) % 7, int('8' 3, 16) % 7, pow(10, 3, 7), 888 % 7)
- What is printed? python print(0.1 0.1, 0.1 0.1 == 0.01, round(0.1 0.1, 2) == 0.01, 10 0.1 0.1 10 == 1)
- What is printed? python print(len(str(777)), 777 % 1000, str(777)[-3:], int(str(777)[:3]))
- What is printed? python def rpn(tokens): st = [] for t in tokens: if t in ('+', '-', '', '/'): b = st.pop() a = st.pop() if t == '+'…