Aan de slagGa gratis aan de slag

Checking ingredients

You're building your recipe scaler for the tomato and basil pasta party! Before scaling up the recipe, you need to check if you have enough of each ingredient in your pantry. The ingredients_needed dictionary contains the quantities needed, and the pantry_stock dictionary contains what you currently have. You'll use conditional statements to determine whether you can proceed with the full recipe, need to buy more ingredients, or should scale down the party size.

Deze oefening maakt deel uit van de cursus

Introduction to Python for Developers

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Check if you have enough tomatoes for the full party
____ pantry_stock["tomatoes"] ____ ingredients_needed["tomatoes"]:
    ____
Code bewerken en uitvoeren