- 1

# Python Paint cost challenge

whatâs wrong with this code? when i run it one case (case 3) fails out of 5. def Color(x): r = x*5.00+40.00 t = r/10 return round(r+t) c = int(input()) print(Color(c))

2 Answers

+ 8

Irshod Yakubi
Try using ceil function for rounding value.
import math as m
def Color(x):
r = x*5.00+40.00
t = r/10
return m.ceil(r+t)
c = int(input())
print(Color(c))

0

c=40
paint=int(input())
total =(c+paint*5)
tax=(total *10//100)
print (total + tax )