0
Paint color: Canât pass test 3 and 4, whatâs wrong?
import math as m paint = input() art = 40 pcost = 5 tax = 0.1 tcost = (int(paint)*pcost)+art tcost += tcost * tax print(m.floor(tcost))
2 RĂ©ponses
+ 3
Evgeny Sergeev
use round instead of floor
print (round(tcost))
+ 5
since the task description says:
Output Format
A number that represents the cost of your purchase rounded up to the nearest whole number
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
so round() would not give the correct result. we have to use ceil() from math module instead.