ProgrammingHardTCS NQT · Accenture

What is printed?

What is printed?
print(5 // 0.5, 5 % 0.5)
  1. A. 11 0.0
  2. B. 9.0 0.0
  3. C. 10.0 0.0
  4. D. 10.0 0.5

Correct answer: C. 10.0 0.0

Mixing an int with a float makes the result a float, so both values print with a decimal point.

More Python Programming questions

Exams that ask this topic