Sho0osh 1.4
Sho0osh 1.4

Reputation: 9

SyntaxError: invalid syntax, python3

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?

Upvotes: 0

Views: 192

Answers (1)

Gustav Rasmussen
Gustav Rasmussen

Reputation: 3961

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

Upvotes: 3

Related Questions