# Function to calculate tax based on income
def calculate_tax(income):
if income <= 10000:
tax = income * 0.10
elif income <= 50000:
tax = 10000 * 0.10 + (income - 10000) * 0.20
else:
tax = 10000 * 0.10 + 40000 * 0.20 + (income - 50000) * 0.30
return tax
# Input the income
income = float(input("Enter your income: "))
# Calculate the tax
tax = calculate_tax(income)
# Display the tax amount
print(f"Your tax amount is: ${tax:.2f}")
Your tax amount is: $24000.00