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 😭😭😭

14th May 2020, 3:52 PM
『 〖 PRAISE 〗 』
『 〖 PRAISE 〗 』 - avatar
2 ответов
+ 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)
14th May 2020, 6:05 PM
A͢J
A͢J - avatar
+ 2
Thanks It's solved
15th May 2020, 1:05 PM
『 〖 PRAISE 〗 』
『 〖 PRAISE 〗 』 - avatar