0
I made this code for code coach "tax free"problem and it passed 5 out of 6 test cases only 1 is wrong.can anyone help me ???
My code is :- items = str(input()).split(",") sum = 0 for i in items : if float(i) >=20: sum += float(i) if float(i) <= 19: tax = (float(i)*7)/100 sum += tax + float(i) print (sum) Plz tell me my mistake đđđ
2 Answers
+ 1
ă ă PRAISE ă ă Check this
sum = 0
tax = 0
for i in userList :
sum += float(i)
if float(i) < 20:
tax = tax + (float(i) * 7) / 100
sum = sum + tax
print (sum)
+ 2
Thanks
It's solved