Customer_one_total += lovely_loveseat_price customer_one_itemization += Syntax Error?

Hi,

I’m working on the Python Project: Lovely Loveseats.

I’m getting a syntax error on line 15: " File “script.py”, line 15
customer_one_total += lovely_loveseat_price customer_one_itemization +=
^
SyntaxError: invalid syntax"

But don’t understand why its wrong. Would appreciate any feedback thank you! Below is the link and I copied the code.

Thank you,

Orquidea

1 Like

Hi @digitaljumper39419,

Begin by focusing on the error message:

File “script.py”, line 15
customer_one_total += lovely_loveseat_price customer_one_itemization +=
^
SyntaxError: invalid syntax

When dealing with a SyntaxError, examine the line that it references, as well as what immediately precedes and follows than line.

On lines 13 through 16, you have this:

customer_one_itemization = ""

customer_one_total += lovely_loveseat_price customer_one_itemization += 
lovely_loveseat_description

Are those all valid statements? If not, what needs to be done to correct the problem?

1 Like

Thank you, I had some spelling errors. I appreciate your feedback :grinning:

Ah, I suspect @appylpye might have meant something else - execution of that code doesn’t get so far as to consider what the names are at all, there’s a bigger problem, namely that what you wrote doesn’t mean anything - to the point that python can’t even attempt to run it! That’s why you get a syntax error. This may be easier to spot with much shorter variable names (less visual clutter):
a += b a += c
That doesn’t fit any pattern that python knows how to deal with, python will protest when it reads your file before it starts running the code.

Yes, something other than spelling errors is amiss.

This portion of line 15 looks like an assignment statement:

customer_one_total += lovely_loveseat_price

However, line 15 continues past that, rendering it incomprehensible to the Python interpreter . You may have intended to start a new line, but … well, see @ionatan’s example.