ProgrammingHardProduct-company MCQ pattern

What is printed?

What is printed?
print(round(1234.5678, -2), round(-1234.5678, 2), round(0.000123456, 5))
  1. A. 1200.0 -1234.56 0.00012
  2. B. 1200.0 -1234.57 0.00012
  3. C. 1234.0 -1234.57 0.00012
  4. D. 1200.0 -1234.57 0.00013

Correct answer: B. 1200.0 -1234.57 0.00012

round with a negative digit count rounds to hundreds and still returns a float. Rounding -1234.5678 to two places gives -1234.57, and 0.000123456 rounds to 0.00012 at five places.

More Python Programming questions

Exams that ask this topic