Question 3
Back to Exercise
What is the output of the following Python program?
print(int(3.99), int(-3.99), round(2.5), round(3.5), round(-0.5))
- A 3 -3 2 4 0 Correct
- B 4 -4 3 4 -1
- C 3 -4 3 4 0
- D 3 -3 3 4 -1
Correct Answer: Option A
int() truncates toward zero. round() sends halves to the even neighbour: 2.5 → 2, 3.5 → 4, -0.5 → 0 (printed as 0).
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!