ProgrammingVery hardProduct-company MCQ pattern

What is printed?

What is printed?
print(round(0.1 * 0.1, 3) == 0.01, round(2.345, 2), round(2.355, 2))
  1. A. True 2.34 2.36
  2. B. False 2.35 2.35
  3. C. True 2.35 2.36
  4. D. True 2.35 2.35

Correct answer: D. True 2.35 2.35

0.1 * 0.1 is close enough to 0.01 that rounding to three places gives the same float. 2.345 and 2.355 are both stored a little below their midpoints, so each rounds down to 2.35.

More Python Programming questions

Exams that ask this topic