In the Len’s Slice Exercise, I get an error when attempting to append [2.5, “peppers”] to a pre-existing 2D array.
toppings = ["pepperoni", "pineapple", "cheese", "sausage", "olives", "anchovies", "mushrooms"]
prices = [2.0, 6.0, 1.0, 3.0, 2.0, 7.0, 2.0]
pizza_and_prices = list(zip(prices,toppings))
pizza_and_prices.insert( 2.5,"peppers")
I get the following error
Blockquote
Traceback (most recent call last):
File “script.py”, line 31, in
pizza_and_prices.insert( 2.5,“peppers”)
TypeError: integer argument expected, got float
Blockquote
Any ideas?