45,301 views
43 votes
43 votes
Write a program that asks the user to enter their yearly income. The program should display the user's tax bracket according to the following guidelines: Income below $50,000: Tax Bracket 1 Income of $50,000 - $99,999.99: Tax Bracket 2 Income of $100,000 or above: Tax Bracket 3 The program should then output the amount of federal taxes they will have to pay given that the Federal Tax Rate is 15% (for all tax brackets).

User GooDeeJAY
by
3.2k points

1 Answer

18 votes
18 votes

Answer:

Step-by-step explanation:

The following Python code asks the user for their yearly income as an input, saves it into a variable called income. Then it analyzes that value and outputs their correct Tax Bracket using IF statements. Then it calculates the amount of tax they must pay and outputs that value.

income = input("Enter your yearly income: ")

if int(income) < 50000:

print("You are in Tax Bracket 1")

elif (int(income) >= 50000) and (int(income) <= 99999.99):

print("You are in Tax Bracket 2")

else:

print("You are in Tax Bracket 3")

tax = int(income) * 0.15

print("You need to pay a total of $" + str(tax) + " in income tax")

Write a program that asks the user to enter their yearly income. The program should-example-1
User Gentlejo
by
2.8k points