ProgrammingHardProduct-company MCQ pattern

What is printed?

What is printed?
print(int(1e15 + 0.3) == 10**15, round(1e15 + 0.3) - 10**15)
  1. A. False 0
  2. B. True 1
  3. C. True 0
  4. D. True 0.25

Correct answer: C. True 0

1e15 + 0.3 is stored as 1000000000000000.25, so int truncates to 10**15 and round gives the same integer. The difference is 0.

More Python Programming questions

Exams that ask this topic