It is telling me that I have an invalid syntax error in my code (I am using Python3, btw). What is wrong with it? The code is below:

num = float(input("What is your first number, %s? (Enter the first you will be using): " %(name, )))

Respuesta :

I copied and pasted your post into my Python3.5.1 interpreter and got:

>>> name = "roger"
>>> num = float(input("What is your first number, %s? (Enter the first you will be using): " %(name, )))
What is your first number, roger? (Enter the first you will be using): 43.0
>>> num
43.0

Your code looks good, and runs good. At this point, I'd be suspicious that you're trying to execute this on a Python2.x interpreter. Try this (I translated to PythonV2 and tested it):

num = float(raw_input("What is your first number, %s? (Enter the first you will be using): " %(name, )))