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

Connected

Exercise

Checking equality

Before scaling the recipe, you need to check if you have the exact amount of basil required. You'll use an equality check with an if/else statement to determine whether you have exactly the right amount or need to adjust your shopping list.

The integer variables basil_grams and required_basil have been preloaded for you.

Instructions

100 XP
  • Use an equality check to compare basil_grams with required_basil in the if statement condition.
  • Else, print a message when you don't have the exact amount needed.