ProgrammingVery hardJEE Advanced · CAT placement

What is printed?

What is printed?
print(10**400 > float('inf'), float('inf') > 10**400, float(10**308) == 10**308)
  1. A. True False True
  2. B. False True True
  3. C. True True False
  4. D. False True False

Correct answer: D. False True False

No finite int is greater than infinity, but Python compares int and float exactly, and inf is above every int. 10**308 is not exactly a double, so float(10**308) is not equal to the int.

More Python Programming questions

Exams that ask this topic