+ 1
What's wrong with my code
It's a code challenge. At Easy level . Name paint cost https://code.sololearn.com/ciCPBLHJ851V/?ref=app
7 Respuestas
+ 12
Nikolai Ivanov , as you mentioned that the cost for your purchase has to be rounded UP, the round() function is not the appropriate tool. Rounding UP correctly (to the next higher whole number) can be done with math.ceil() but not with round().
round(7.4) -> 7
round(7.6) -> 8
------
ceil(7.4) -> 8
ceil(7.6) -> 8
+ 5
Nikolai Ivanov , Vral Vyas , i did this coach code exercise some months ago using ceil(). It passed all cases.
So if it fails, there must be an other problem.
+ 2
Output Format
A number that represents the cost of your purchase rounded up to the nearest whole number.
You need round up the cost.
Example:
int(0.7) = 0
round(0.7) = 1
+ 1
cost = round (price + price/10)
+ 1
Right answer . But I have to use round
+ 1
Lothar, but with function math.ceil() tests failed.
0
No I try it .it work as ok as round ()