ProgrammingVery hardProduct-company MCQ pattern

What is printed?

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

Correct answer: C. True True False

10 / 3 * 3 rounds back to exactly 10.0, and the integer identity always holds. a % b / b is 1/3 computed directly, while (a / b) % 1 is 10/3 rounded before taking the fraction, so they differ in the last bits.

More Python Programming questions

Exams that ask this topic