ProgrammingVery hardProduct-company MCQ pattern
What is printed?
What is printed?
print(2 ** 63 - 1 == 9223372036854775807, (2 ** 63) % 10, -2 ** 63 // 10)
- A. True 8 -922337203685477580
- B. True 2 -922337203685477581
- C. True 8 -922337203685477581
- D. False 8 -922337203685477581
Correct answer: C. True 8 -922337203685477581
2**63 - 1 is the usual 64-bit signed maximum, and the comparison is exact. 2**63 ends in 8, and -2**63 // 10 floors -922337203685477580.8 to -922337203685477581.
More Python Programming questions
- What is printed? python print(str(10 15 / 10), str(10 16 / 10), 10 16 // 10)
- What is printed? python print('%.3g' % 0.0001234, '%.3g' % 123456.0, '%g' % 0.5)
- What is printed? python print(max('7', '10'), max(7, 10), min('7', '10'), '7' > '10')
- What is printed? python print(len(f'{3.5:>8.2f}'), f'{-3.5:08.1f}', f'{12:#06x}', f'{7:+05d}')
- What is printed? python print('abc'.encode() == b'abc', b'abc'.decode() == 'abc', 'é'.encode('utf-8') == b'xc3xa9', len(b'xc3xa9'.decode()))
- What is printed? python print('%.3s' % 'abcdef' + '|' + '%-4d|' % 7 + '%04.1f' % 2.25)