Write a Python function that determines the tax amount accordingto the following tax rules:
In-state residents: if single and income 30000, tax rate: 20%, if single and income
30000, tax rate: 25%. If married and income
50000, tax rate: 10%, if married and income
50000, tax rate: 15%.
Out-of-state residents: for ALL rules, tax rate is 3%higher.
Function is compute_tax(income, status, state). Income is anint, status is string ‘single’ or “married”, state is char ‘i’ or’o’. The function computes and returns the tax amount.
We were unable to transcribe this imageWe were unable to transcribe this imageWe were unable to transcribe this imageWe were unable to transcribe this imageShow transcribed image text
Expert Answer
Answer to Write a Python function that determines the tax amount according to the following tax rules: In-state residents: if sing…