Skip to content

Instantly share code, notes, and snippets.

@magi196502
Forked from codecademydev/script.py
Created November 8, 2018 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magi196502/b19241b4048fd0e32e469b0d21528bfb to your computer and use it in GitHub Desktop.
Save magi196502/b19241b4048fd0e32e469b0d21528bfb to your computer and use it in GitHub Desktop.
Codecademy export
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 kinds of pizza!")
pizzas = list(zip(prices, toppings))
print(pizzas)
pizzas.sort()
cheapest_pizza = pizzas[0]
priciest_pizza = pizzas[-1]
three_cheapest = pizzas[:3]
print(three_cheapest)
num_two_dollar_slices = prices.count(2)
print(num_two_dollar_slices)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment