Get startedGet started for free

Building the recipe scaler

You've learned all the building blocks - now it's time to bring everything together! Your recipe scaler needs to: check if you have enough ingredients in your pantry, scale the recipe for more servings, and create a shopping list for missing items. The original tomato and basil pasta recipe serves 4 people, and you're hosting a party for 10.

Your pantry has been set up as a dictionary with current quantities, and the recipe dictionary contains the base ingredient amounts. The scale_factor has also been set up as party size / original serving size (10/4).

This exercise is part of the course

Introduction to Python for Developers

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

shopping_list = []

# Loop through each ingredient and amount in the recipe
for ____, ____ in ____:
  print(ingredient)
Edit and Run Code