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

Connected

Exercise

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.

Instructions 1/3

undefined XP
    1
    2
    3
  • Write an if statement to check if pantry_stock["tomatoes"] is greater than or equal to ingredients_needed["tomatoes"]. If true, print "Enough tomatoes for the party!".