toppings = [“pepperoni”, “pineapple”, “cheese”, “sausage”, “olives”, “anchovies”, “mushrooms”]
print(toppings)
prices = [2, 6, 1, 3, 2, 7, 2]
print(prices)
num_two_dollar_slices = prices.count(2)
print(num_two_dollar_slices)
num_pizzas = len(toppings)
print(num_pizzas)
str(num_pizzas)
print(" we sell " + str(num_pizzas) + " different kinds of of pizza!")
pizzas_and_prices = [[2,“pepperoni”] + [6, “pineapple”] + [1, ‘cheese’] + [3, ‘sausage’] + [2, ‘olives’] + [7, “anchovies”] + [2, ‘mushrooms’]]
print(pizzas_and_prices)
print(pizzas_and_prices)
pizzas_and_prices.sort()
print(pizzas_and_prices.sort
Ok so the above code is where Im at on the “len’s list exercise”, when I sort this, by default according to the lessons it should go into ascending order. however thats not whats happening here. When I use the print function, its spitting the information out in the same order in which the sub lists were entered. newlist = .sorted(list) does the exact same thing
Anyone can give a tip ?