1. Learn
  2. /
  3. Courses
  4. /
  5. Python for MATLAB Users

Connected

Exercise

Get data out

In this exercise, you're going to practice exploring dictionaries and retrieving data stored in a simple dictionary. The dictionary avocados is loaded into your workspace, which includes information about a single purchase of avocados.

The dictionary has the following keys:

  • variety is the variety of avocado purchased.
  • count is the number of avocados purchased.
  • price_each is the price per avocado, in USD.
  • organic indicates whether or not these are organic avocados.
  • date is the date of this purchase.

Let's use these keys to learn more about this transaction.

Instructions 1/4

undefined XP
  • 1

    Print the value of the key "variety" in the dictionary avocados.

  • 2

    Print the value of the key "price_each" in the dictionary avocados.

  • 3

    Print the value of the key "organic" in the dictionary avocados.

  • 4

    Print the value of the key "count" in the dictionary avocados.