ProgrammingVery hardCAT · MBA placement

What is printed?

What is printed?
print(round(1234, -2), round(1250, -2), round(1350, -2))
  1. A. 1200 1300 1400
  2. B. 1200 1300 1300
  3. C. 1200 1200 1300
  4. D. 1200 1200 1400

Correct answer: D. 1200 1200 1400

round with a negative digit count rounds to tens or hundreds using round-half-to-even. 1250 is exactly halfway between 1200 and 1300, so it goes to the even hundred, 1200, and 1350 goes up to 1400.

More Python Programming questions

Exams that ask this topic