ProgrammingVery hardProduct-company MCQ pattern
What is printed?
What is printed?
print(0.5 ** 1074 == 0, 5e-324 > 0, 5e-324 / 2 == 0)
- A. True True True
- B. False True False
- C. False True True
- D. True False True
Correct answer: C. False True True
0.5 ** 1074 is the smallest positive subnormal, so it is not zero. Halving the smallest subnormal rounds to zero, which is a tie that goes to the even value.
More Python Programming questions
- What is printed? python print('abcabc'.replace('abc', 'x', 1), 'aaaa'.replace('aa', 'b'), 'aaa'.replace('', '-'))
- What is printed? python print('Mississippi'.lower().count('s'), 'Mississippi'.find('ss'), 'Mississippi'.rfind('ss'))
- What is printed? python print(float('-0') == 0.0, str(float('-0')), str(float('+0')))
- What is printed? python print(sum(1 for i in range(1, 1001) if '7' in str(i)))
- What is printed? python print(int(str(12345)[::-1]) - 12345, 12345 - int(str(12345)[::-1]))
- What is printed? python print(len(bin(-1)), len(hex(255)), oct(64))