ProgrammingHardProduct-company MCQ pattern

What is printed?

What is printed?
print(float(1) / 3 + float(2) / 3 == 1.0, 0.1 * 0.1 * 100 == 1.0, 1 - 0.1 * 9 == 0.1)
  1. A. True False False
  2. B. False False False
  3. C. True True False
  4. D. True False True

Correct answer: A. True False False

One third plus two thirds rounds to exactly 1.0, but 0.1 * 0.1 * 100 picks up error and 1 - 0.9 is not the double 0.1.

More Python Programming questions

Exams that ask this topic