BaşlayınÜcretsiz Başlayın

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

Bu egzersiz

Introduction to Python for Developers

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

shopping_list = []

# Loop through each ingredient and amount in the recipe
for ____, ____ in ____:
  print(ingredient)
Kodu Düzenle ve Çalıştır