0

Paint Costs

Test case 3 always fails help me anyone Buy = int(input("")) def paint(n): color = n * 5 + 40 tax = color * 0.1 total = tax + color print(round(total)) n = Buy paint(n)

5th Jan 2020, 7:06 AM
Thomas Luke
Thomas Luke - avatar
3 Answers
+ 2
Yes you need to round UP, not just round. Math.Ceiling(number) rounds up, whereas Round(number) just rounds in the nearest direction. That is using C# syntax though, I'm unsure how to call it in Python.
5th Jan 2020, 7:58 AM
{ Aza }
{ Aza } - avatar
+ 2
This was my solution which passed all cases. I'm sorry, I don't think you need to import a module for a task as small as this def total_cost(num_of_paint): num_of_paint = int(input()) x = num_of_paint paint = 5.00 * x canvas_and_brushes = 40.00 total_cost = paint + canvas_and_brushes tax = total_cost/10 total_cost = total_cost + tax total_cost = round(total_cost) return int(total_cost) print(total_cost(10))
14th Nov 2020, 6:00 AM
Clare Apumami
Clare Apumami - avatar
0
Thank you both 😃✓ { Aza } ~ swim ~
5th Jan 2020, 8:13 AM
Thomas Luke
Thomas Luke - avatar