SYNTAX ERROR in python

Prompt: Create a variable that will hold a float. Use the variable to get input from the user. Make sure your question to the user makes sense for collecting a value that is a float.

#Calculate yearly income

monthly_income=3657.55
months=12
yearly_income=months*monthly_income
print(‘please enter your yearly income’)

When I run the program I receive a syntax error.

1 Like

Could you paste the full error?

it says invalid syntax error when I run it on IDLE

Well, with the exception of weird quotation marks around the text in the print function, rest of the code doesn’t seem to have anything that might cause the syntax error. So if that’s not it, then unless error says something more it might be hard to help.

When I put it in the terminal as is:

#Calculate yearly income

monthly_income=3657.55

months=12

yearly_income=months*monthly_income

print(‘What is your yearly income’,yearly_income)

What is your yearly income 43890.600000000006

I don’t receive an error but when I go on idle and try to run it I receive a syntax error and the program doesn’t calculate the math problem

Hi,

I also checked with idle and the problem are the quotes! They are not valid. Try to use “…”

I do not know why you want to enter the yearly income? You have calculate that.
Maybe you want to print it? In that case you have to write:
print("The yearly income is {}".format(yearly_income))

Thank you so much !!!

You are welcome! Enjoy Python!