Python Forum
Keyword cannot be an expression - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Keyword cannot be an expression (/thread-2349.html)



Keyword cannot be an expression - YorgosTheProgramer - Mar-08-2017

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))


RE: Keyword cannot be an expression - Larz60+ - Mar-08-2017

you have other issues, but this will get you started:

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