ProgrammingVery hardJEE Advanced · CAT placement

What is printed?

What is printed?
print(int(1e22) == 10**22, int(1e23) == 10**23, float(10**22) == 1e22)
  1. A. True True True
  2. B. True False True
  3. C. False False True
  4. D. True False False

Correct answer: B. True False True

10**22 is exactly representable as a double, so the float and the int agree. 10**23 is not, and the literal 1e23 rounds to a slightly different integer.

More Python Programming questions

Exams that ask this topic