Why it prints 14.445 instead of 14.45 when I input 3 ?
x = int(input()) n = 5 n *= x if x > 1 : for i in range(x) : z = ((n * 10) / 100) e = n - z y = ((e * 7) / 100) print(y + e) elif x == 1 : y = ((n * 7) / 100) print(y + n) I have a project and that is, You sell items that cost 5 Dollars and if the customer buys more than 1, he will get a 10% discound on all of them. And the tax is 7% (doesnt matter how many he buys). For example : Input: 4 Output: 19.26 Explanation: Buys 4 items and gets 10% discound on all of them and the 7% tax, the total is 19.26. But the thing is that this code outputs 14.445 when I input 3, it should output 14.45. And I need help! I dont know why it doesnt work when I input 3. Any help will be appreciated.