ProgrammingModerateProduct-company MCQ pattern

What is printed?

What is printed?
print(float('inf') > 2**1000, -float('inf') < -(2**1000), float('inf') == float('inf') + 1)
  1. A. True True True
  2. B. True True False
  3. C. False True True
  4. D. True False True

Correct answer: A. True True True

Infinity compares greater than any int, even one with a thousand digits. Adding 1 to infinity leaves it infinite, so it equals infinity.

More Python Programming questions

Exams that ask this topic