Getting a SyntaxError: invalid syntax for a two dimensional list

Convert our toppings and prices lists into a two-dimensional list called pizza_and_prices that has the following associated values.

Each sublist in pizza_and_prices should have one pizza topping and an associated price.

Price Topping
2 "pepperoni"
6 "pineapple"
1 "cheese"
3 "sausage"
2 "olives"
7 "anchovies"
2 "mushrooms"

For this project make sure the prices come before the topping name like so:

[price, topping_name]

i created the two dimensional list in this question i done it as i know i will paste what i wrote. pizza_and_prices = [[2, “pepperoni”], [6, “pineapple”], [1, “cheese”], [3, “sausage”], [2, “olives”], [7, “anchovies”], [2, “mushrooms”]]. Someone give me another option as a syntax error keeps coming up

Hey there and welcome to the forums!! :slightly_smiling_face:

Your list itself doesn’t seem to throw an error, so could probably use more context.
What error are you getting?
What are you doing to the list that’s throwing the error?

1 Like

There are also several threads here in the forums that discuss this very topic about the project Len’s Pizza. That might be a good place to start.

1 Like

Could it be that you used the wrong type of quotes? I do not know what they are called (maybe smart quotes?). When I copied and pasted your list to the VS Code, I got Expected Expression and "[" not closed errors. But when I changed from the double quotes you used to the regular double quotes, all the errors went away. Could it be this? Because everything else seems fine.

1 Like

i am getting a SyntaxError: invalid syntax which has me confused as i input my code on PY CHARM and it works perfectly fine

Thank you i will give it a try much appreciated for your help

1 Like

I will have a look thank you for your help much needed

1 Like