-
-
Save codecademydev/bf3ddbdd0bb6f9f8c5f5f2b1703e9c4a to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
toppings = ["pepperoni", "pineapple", "cheese", "sausage", "olives", "anchovies", "mushrooms"] | |
prices = [2 , 6 , 1 , 3 , 2 , 7 , 2] | |
num_pizzas = len(toppings) | |
print("We sell " + str(num_pizzas) + " different kind of pizza!") | |
pizzas = list(zip(prices, toppings)) | |
print(pizzas) | |
pizzas_sorted = sorted(pizzas) | |
cheapest_pizza = pizzas_sorted[0] | |
priciest_pizza = pizzas_sorted[-1] | |
three_cheapest = pizzas_sorted[0:3] | |
print(three_cheapest) | |
num_two_dollar_slices = pizzas_sorted.count(2) | |
print(pizzas_sorted) | |
print(num_two_dollar_slices) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment