Python: Basic: Calculate Tax

Write the function calculate_tax that takes a float income and returns the corresponding tax of the income using the following tax brackets.


$0 to $9,875$9,876 to $40,125$40,126 to $85,525$85,526 to $163,300$163,301 to $207,350$207,351 to $518,400$518,401 or more
10%12%22%24%32%35%37%
calculate_tax(10) -> 150
calculate_tax(40) -> 700

Test 1    

Test 2    

Test 3    

Test 4    

Test 5    

Test 6    

Test 7    

Test 8