ProgrammingHardProduct-company MCQ pattern

What is printed?

What is printed?
print(10**-1 + 10**-1 + 10**-1 == 0.3, 1/10 + 1/10 + 1/10 == 0.3, 10**-1 == 1/10)
  1. A. True True True
  2. B. False False True
  3. C. False True True
  4. D. False False False

Correct answer: B. False False True

10 ** -1 is the same float as 1 / 10, so the sums are identical and both miss 0.3 by one unit in the last place. The equality of the two single values is True.

More Python Programming questions

Exams that ask this topic