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?
Roberto Caboni
7,51010 gold badges29 silver badges42 bronze badges
-
Line 2 is blank, so you must mean line 3, yeah?wjandrea– wjandrea2024年09月05日 18:53:28 +00:00Commented Sep 5, 2024 at 18:53
1 Answer 1
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
answered Jun 10, 2020 at 11:52
Gustav Rasmussen
4,0394 gold badges32 silver badges56 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-py