tax = [
(10000, 1),
(50000, 5),
(1000000, 50)
]
print("Before: 1000, After: 0")
def deduce(bracket, amm):
tax = 0
last_limit = 0
for limit, tax_percent in bracket:
taxable = min(amm, limit) - last_limit
tax += taxable * (tax_percent * .01)
last_limit = limit
return tax
print("...")
print(f"{1000000 - deduce(tax, 1000000):.2f}")