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

Connected

Exercise

Working with dictionaries

So far, you've added the ingredients with their quantities in grams.

Now, you want to practice accessing the dictionary's contents using different methods to confirm the dictionary is set up as expected, and to prepare for scaling later on.

Instructions

100 XP
  • Use a method to retrieve all the keys from the recipe dictionary and assign the result to ingredient_names.
  • Use a method to retrieve all the values from the recipe dictionary and assign the result to quantities.
  • Use a method to retrieve all key-value pairs from the recipe dictionary and assign the result to recipe_items.