Question: Python code: Only allowed to use conditional statements like (if elif else) def bracket_income(income, filing_status, bracket): Description: It returns the amount of the persons income
Python code:
Only allowed to use conditional statements like (if elif else)
def bracket_income(income, filing_status, bracket):
Description: It returns the amount of the persons income that falls within a certain bracket based on the following table:
| bracket | Income (single) | Married (jointly) | Married (separately) |
| 1 | $0 to $10,000 | $0 to $20,000 | $0 to $12,000 |
| 2 | $10,000.01 to $40,000 | $20,000.01 to $70,000 | $12,000.01 to $44,000 |
| 3 | $40,000.01 to $80,000 | $70,000.01 to $160,000 | $44,000.01 to $88,000 |
| 4 | $80,000.01 to $160,000 | $160,000.01 to $310,000 | $88,000.01 to $170,000 |
| 5 | $160,000.01 or more | $310,000.01 or more | $170,000.01 or more |
Parameters: income (float) and filing_status (integer) are the same as above. bracket (integer) is a sequential number that corresponds to a certain tax bracket.
Return value: The amount (float) of income
Examples:
bracket_income(67234, 1, 1) 10000.00
bracket_income(5700.45, 3, 1) 5700.45
bracket_income(620000,2,5)---> 310000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
