ProgrammingModerateTCS NQT · Wipro pattern

What is printed?

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

Correct answer: A. True False 1

10 / 3 gives the nearest double, and multiplying by 3 rounds back to exactly 10.0. 10 // 3 is 3, so 3 * 3 is 9, and 10 % 3 is 1.

More Python Programming questions

Exams that ask this topic