-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlens_slice.py
More file actions
31 lines (21 loc) · 830 Bytes
/
Copy pathlens_slice.py
File metadata and controls
31 lines (21 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# PROJECT: LEN'S SLICE
toppings = ["pepperoni", "pineapple", "cheese", "sausage", "olives", "anchovies", "mushrooms"]
prices = [2, 6, 1, 3, 2, 7, 2]
num_two_dollar_slices = prices.count(2)
print(num_two_dollar_slices)
num_pizzas = len(toppings)
print("We sell ", num_pizzas, " different kinds of pizza!")
pizzas_and_prices = [[2, "pepperoni"], [6, "pineapple"], [1, "cheese"], [3, "sausage"], [2, "olives"], [7, "anchovies"], [2, "mushrooms"]]
print(pizzas_and_prices)
pizzas_and_prices.sort()
print(pizzas_and_prices)
cheapest_pizza = pizzas_and_prices[0]
print(cheapest_pizza)
priciest_pizza = pizzas_and_prices[-1]
print(priciest_pizza)
pizzas_and_prices.pop()
print(pizzas_and_prices)
pizzas_and_prices.insert(4, [2.5, "peppers"])
print(pizzas_and_prices)
three_cheapest = pizzas_and_prices[:3]
print(three_cheapest)