Question 1
Back to Exercise
What is the output of the following Python program?
import math
print(math.sqrt(16), math.floor(-2.5), math.ceil(-2.5), math.trunc(-2.5), math.pi > 3.14)
- A 4.0 -3 -2 -2 True Correct
- B 4 -2 -3 -2 True
- C 4.0 -2 -2 -3 True
- D 4.0 -3 -2 -3 False
Correct Answer: Option A
sqrt returns a float. floor goes down (-3), ceil goes up (-2), trunc goes toward zero (-2).
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!