Invalid syntax error

I’m working on the project Magicall Ball 8. I can’t write the proper syntax to get Joe asks: Will I win the lotter?
The hint is: print(name + "asks: " + question)
My syntax is print( joe "asks am I going to buy a pair of earrings todat?: ")

I have a thousand more combinations but can’t manage

Help would be appreciated

Thanks

Hey there, and welcome to the Codecademy forums!! :slight_smile:

Currently it appears you are trying to supply two arguments to the print() function. The first being a variable joe, and the second being a string "asks am I going to buy a pair of earrings todat?:"

Think about why you are getting a syntax error here. What do you need to do to provide two arguments?

Hint if needed
print(first_argument, second_argument)

Based on the hint provided with the lesson, I don’t think you actually want to pass two arguments in this case. Currently do you actually have a variable, joe, defined in the program? And if you do, my question is why? Based on the hint, it would probably be better for you to use the string concentation they are showing.
You have one variable, name, which holds string of the users name that is added to the string, " asks: ", followed by a variable, question, which holds the string of the users question.

String concentation uses + to combine two or more strings together:

string_1 = "string 1"
string_3 = "string 3"
print(string_1 + " string 2 " + string_3)

# outputs
>> string 1 string 2 string 3

EDIT:
I fixed a typo in the way I had my strings named above, hopefully that didn’t throw you off.

3 Likes