1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Python for Developers

Connected

Exercise

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).

Instructions 1/3

undefined XP
    1
    2
    3
  • Loop through the recipe dictionary to get each ingredient and amount.