Question 6
Back to Exercise
The price should be rounded to the nearest rupee (100). Which statement correctly identifies the bug?
price = 99.99
print("Rs", int(price))
- A int() rounds down only for prices
- B int() truncates toward zero; use round(price) to round to the nearest whole number Correct
- C price must be a string
- D print removes decimals
Correct Answer: Option B
int() simply drops the fractional part.
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!