0
What is the mistake in this code for estimating paint costs
brushes=40.00 rate=5.00 color= int(input()) cost= (color * rate )+ brushes tax= cost * 0.10 total = tax + cost total = round(total ) print(total )
2 Answers
+ 5
Use ceil() instead of round ( reason already told by Gordon )
https://code.sololearn.com/cddIJxrfmQ4d/?ref=app
+ 5
round() is banker's rounding, not maths rounding
https://code.sololearn.com/c3oWdqMonrfA/?ref=app
Banker's rounding means, rounding up and down alternately, so sum of all balances are not overlarge.
Code Coach problems require maths rounding.
You could do this by defining your own rounding function with if else statement.