Python Forum

Full Version: Keyword cannot be an expression
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I just started doing a programing course on python and am running into this error with this simple tax calculator . Would anyone be able to explain to me what ive done wrong in as simple as terms as possible ? Thank you in advanced ! Smile

TAXRATE = 0.20
STANDARD_DEDUCTION = 10000.0
DEPENDANT_DEDUCTION = 3000.0

grossIncome = float(input("Enter the gross income"))
numDependants = int(input("Enter the number of dependants"))

taxableIncome = grossIncome - STANDARD_DEDUCTION \
                - DEPENDANT_DEDUCTION * numDependants

incomeTax = taxableIncome * TAX_RATE

print("The income tax is $" = str(incomeTax))
you have other issues, but this will get you started:

change TAXRATE to TAX_RATE
and
print("The income tax is ${}".format(incomeTax))