0
income=float(input("enter the annual income: ")

if income<85528:
  tax=(income-556.02)*0.18
else:
  tax=(income-85528)*0.32+14839.02

tax=round(tax,0)
print("the tax is: ", tax, "thalers")

Why does it keep giving an error on line 2?

1
  • Line 2 is blank, so you must mean line 3, yeah? Commented Sep 5, 2024 at 18:53

1 Answer 1

3

You have a lacking parenthesis in the 1st line: ")". It can be fixed by:

income = float(input("enter the annual income: "))

Complete program:

income = float(input("enter the annual income: "))

if income < 85528:
    tax = (income - 556.02) * 0.18
else:
    tax = (income - 85528) * 0.32 + 14839.02

tax = round(tax, 0)
print("the tax is: ", tax, "thalers")

Returns:

enter the annual income: 435
the tax is:  -22.0 thalers
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.