ProgrammingModerateTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
import math
print(math.isqrt(99), math.isqrt(100), round(2.5), round(3.5))
  1. A. 10 10 2 4
  2. B. 9 10 2 3
  3. C. 9 10 2 4
  4. D. 9 10 3 4

Correct answer: C. 9 10 2 4

isqrt returns the floor of the exact square root, so 99 gives 9 and 100 gives 10. round uses banker's rounding: ties go to the even neighbour, so 2.5 becomes 2 and 3.5 becomes 4.

More Python Programming questions

Exams that ask this topic