ProgrammingVery hardJEE Advanced · CAT placement
What is printed?
What is printed?
print(float('1' + '0' * 308) == 1e308, 10 ** 308 > 1e308, 10 ** 308 < 1e308)- A. True True False
- B. False True False
- C. True False True
- D. True True True
Correct answer: C. True False True
The string and the literal 1e308 parse to the same double. That double is slightly above 10**308, so the exact int is less than the float.
More Python Programming questions
- What is printed? python from functools import reduce print(reduce(lambda acc, ch: acc 10 + int(ch), '2024', 0), reduce(lambda acc, ch: acc…
- What is printed? python print('{0:>{1}}'.format('x', 3), '{:0>3}'.format(7), '{:x<4}'.format('ab'), '{:^7.3f}|'.format(2.5))
- What is printed? python print(1 == True == 1.0, 2 > 1 == True, (2 > 1) == True, 1 < 2 == True)
- What is printed? python print(int(' 0x1f ', 16), int('1e3', 16), float('1e3'))
- What is printed? python from collections import Counter c = Counter(['x', 'y', 'x', 'z', 'y', 'x']) print(c.mostcommon()…
- What is printed? python print(10 % 3 2, 10 % (3 2), (10 % 3) 2, -10 % 3 2)