New Problem
1
Setup
2
Details
3
Solution
4
Tests
5
Types
Generating solution...
Pizza Factory
You're helping run a pizza factory! The factory keeps track of different pizza types and how many of each type they've made today.
Your job is to write a program that uses a dictionary to store pizza data and perform some basic operations.
Create a dictionary called `pizza_count` with the following pizza types and their counts:
- "pepperoni": 45
- "cheese": 32
- "veggie": 18
- "supreme": 23
Then write code to:
1. Print the total number of pizzas made today
2. Print which pizza type was made the most
3. Add 5 more "cheese" pizzas to the count
4. Print the updated count for "cheese" pizzas
Example output:
Total pizzas made: 118
Most popular pizza: pepperoni
Updated cheese count: 37
Writing unit tests for Pizza Factory...
Pizza Factory
You're helping run a pizza factory! The factory keeps track of different pizza types and how many of each type they've made today.
Your job is to write a program that uses a dictionary to store pizza data and perform some basic operations.
Create a dictionary called `pizza_count` with the following pizza types and their counts:
- "pepperoni": 45
- "cheese": 32
- "veggie": 18
- "supreme": 23
Then write code to:
1. Print the total number of pizzas made today
2. Print which pizza type was made the most
3. Add 5 more "cheese" pizzas to the count
4. Print the updated count for "cheese" pizzas
Example output:
Total pizzas made: 118
Most popular pizza: pepperoni
Updated cheese count: 37
Generating 5 problem types...
Pseudocode, Blocks, Fill-in-the-blank Blocks, Fix Code, and Write Code
Pizza Factory
You're helping run a pizza factory! The factory keeps track of different pizza types and how many of each type they've made today.
Your job is to write a program that uses a dictionary to store pizza data and perform some basic operations.
Create a dictionary called `pizza_count` with the following pizza types and their counts:
- "pepperoni": 45
- "cheese": 32
- "veggie": 18
- "supreme": 23
Then write code to:
1. Print the total number of pizzas made today
2. Print which pizza type was made the most
3. Add 5 more "cheese" pizzas to the count
4. Print the updated count for "cheese" pizzas
Example output:
Total pizzas made: 118
Most popular pizza: pepperoni
Updated cheese count: 37
Available Steps
Add 5 more cheese pizzas to the count
Create a dictionary with pizza types and counts
Print the updated cheese count
Find and print the most popular pizza
Calculate and print the total number of pizzas
Your Solution (drag steps here)
Available Code Blocks
pizza_count["cheese"] += 5
print(f"Updated cheese count: {pizza_count['cheese']}")
most_popular = max(pizza_count, key=pizza_count.get)
print(f"Total pizzas made: {total_pizzas}")
total_pizzas = sum(pizza_count.values())
print(f"Most popular pizza: {most_popular}")
pizza_count = {"pepperoni": 45, "cheese": 32, "veggie": 18, "supreme": 23}
Your Solution (drag blocks here)
Available Code Blocks
pizza_count[] +=
print(f"Updated cheese count: {pizza_count[]}")
= max(pizza_count, key=pizza_count.get)
print(f"Total pizzas made: {}")
= sum(pizza_count.values())
print(f"Most popular pizza: {}")
pizza_count = {"pepperoni": 45, "cheese": 32, "veggie": 18, "supreme": 23}
Your Solution (drag blocks here)
View feedback here after running your solution