Hi! I am on this project and I am stuck on step 11. This is the code that I have got from the pizza_and_prices 2D list:
pizza_and_prices = [
[2, "pepperoni"],
[6, "pineapple"],
[1, "cheese"],
[3, "sausage"],
[2, "olives"],
[7, "anchovies"],
[2, "mushrooms"]
]
pizza_and_prices.sort()
print(pizza_and_prices)
cheapest_pizza = pizza_and_prices[0]
priciest_pizza = pizza_and_prices[-1]
pizza_and_prices[-1].pop([7, "anchovies"])
print(pizza_and_prices)
In the pizza_and_prices[-1].pop([7, "anchovies"])
there is an error: TypeError: 'list' object cannot be interpreted as an integer
. I have tried other variations, but I can’t seem to remove the whole [7, "anchovies"]
from the end of the 2D list.
Thanks in advance for any help!