ProgrammingVery hardProduct-company MCQ pattern

What is printed?

What is printed?
print(1 / 3 * 3 == 1.0, 2 / 3 * 3 == 2.0, 10 / 3 * 3 == 10.0, 0.7 * 3 == 2.1)
  1. A. True True True False
  2. B. True True False False
  3. C. True False True False
  4. D. False True True False

Correct answer: A. True True True False

Some products of a division and a multiplication round back exactly, but 0.7 * 3 gives 2.0999999999999996, which is not the nearest double to 2.1.

More Python Programming questions

Exams that ask this topic