First project

lovely_loveseat_description= 'Lovely Loveseat . Tufted polyster blend on wood . 32 inches highx 40 inches wide x 30 inches deep . Red or white.'
lovely_loveseat_price= '254.00'
stylish_settee_description= "Stylish Settee. Faux leather on birch .29.50 inches high x    54.75 inches wide x 28 inches deep .  Black."
stylish_settee_price= "180.50"
luxurious_lamp_description= "Luxurious Lamp. Glass and iron . 36 inches tall. Brown with    cream shade".
luxurious_lamp_price= "52.15"
sales_tax= ".088"
customer_one_total= "0" += "52.15" 
customer_one_itemization= "Luxurious Lamp . Glass and iron . 36 inches tall . Brown, With cream shade"
customer_one_tax= customer_one_total * sales_tax= 53.03 or 45.892
print("Customer One Items:").
print('customer_one_itemization')
print("Customer One Total:")= 53.03 

How Do I fix the error

Hello, @text5410759995, and welcome to the forums. I formatted your code, to try to determine what your issues might be. There are several syntax errors in the code. Is this how your code appears in the exercise? If not, copy your code again, and click the </> button here in the forum message composition window. Then paste your code in the space indicated. Also, after your code, include the error message you see as well as a link to the exercise. Following these steps helps others help you. For more information on formatting code see: How do I format code in my posts?

1 Like

Preformatted text

lovely_loveseat_description= 'Lovely Loveseat . Tufted polyster blend on wood . 32 inches highx 40 inches wide x 30 inches deep . Red or white.'
lovely_loveseat_price= '254.00'
stylish_settee_description= "Stylish Settee. Faux leather on birch .29.50 inches high x    54.75 inches wide x 28 inches deep .  Black."
stylish_settee_price= "180.50"
luxurious_lamp_description= "Luxurious Lamp. Glass and iron . 36 inches tall. Brown with    cream shade".
luxurious_lamp_price= "52.15"
sales_tax= ".088"
customer_one_total= "0" += "52.15" 
customer_one_itemization= "Luxurious Lamp . Glass and iron . 36 inches tall . Brown, With cream shade"
customer_one_tax= customer_one_total * sales_tax= 53.03 or 45.892
print("Customer One Items:").
print('customer_one_itemizatiom')
print("Customer One Total:")= 53.03`Preformatted text`



Hello @text5410759995.

Here are some things for you to consider.

  • Make sure all of your punctuation is inside of quotation marks for your strings. This is an issue for luxurious_lamp_description.
  • You can’t use += on the same line as a variable assignment. This is an issue for customer_one_total. This is because Python evaluates the code on the right side of the equals sign and assigns it to the variable name on the left side of the equals sign. You can’t use += on a variable that has yet to be created.
  • You can’t multiply strings. This is an issue for customer_one_tax. customer_one_total contains a string. To use mathematical operations to calculate the tax, set customer_one_total to a floating-point value instead.
  • If you are going to assign sales_tax the value of either 53.03 or 45.892, you should do it on a separate line and not when initializing the customer_one_tax variable. You should also only assign it one value. The or logical operator is not suitable for this situation.
  • Proofread your code. You have an extra . lying around after your first print statement.
  • When printing the value of a variable, you don’t need to put quotation marks around it, even if that value is a string. Remove the quotation marks surrounding customer_one_itemization in your second print statement.
  • Your third print statement will throw an error. I’m not sure what the = 53.05 is for, but you can’t assign a function call the value of a float.
1 Like
type or paste code here lovely_loveseat_description= 'Lovely Loveseat . Tufted polyster blend on wood . 32 inches highx 40 inches wide x 30 inches deep . Red or white.'
lovely_loveseat_price= '254.00'
stylish_settee_description= "Stylish Settee. Faux leather on birch .29.50 inches high x    54.75 inches wide x 28 inches deep .  Black."
stylish_settee_price= "180.50"
luxurious_lamp_description= "Luxurious Lamp. Glass and iron . 36 inches tall. Brown with    cream shade."
luxurious_lamp_price= "52.15"
sales_tax= ".088"
customer_one_total= "0" 
customer_one_itemization= "Luxurious Lamp . Glass and iron . 36 inches tall . Brown, With cream shade"
customer_one_tax= 52.15 * 0.88
print("Customer One Items:")
print(customer_one_itemization)

customer_one_total=53.05 the 53.05 i corrected the errors you pointed out let me know if you see anymore thanks in advance

Some of your numbers are not consistent. For example, sales_tax = "0.088" and customer_one_tax = 52.15 * 0.88. Make sure all of the numbers represent the accurate value you want.

I would recommend that you make all the prices, totals, and the sales tax floats, not strings (remove the quotation marks). This would allow you to use them in mathematical operations and add to the customer’s running total since adding strings together concatenates them rather than adding the values together.

For example, instead of customer_one_tax = 52.15 * 0.88, you would be able to do customer_one_tax = customer_one_total * sales_tax.

It seems that you are making these numbers strings so that you can print them more easily. However, you can use str() to accomplish this.

Example
luxurious_lamp_price = 52.15
customer_one_total = 0

customer_one_total += luxurious_lamp_price # customer bought a lamp

print("Customer One Total: " + str(customer_one_total)) # displays Customer One Total: 52.15