1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Python for Data Science

Connected

Exercise

Access dictionary

If the keys of a dictionary are chosen wisely, accessing the values in a dictionary is easy and intuitive. For example, to get the capital for France from europe you can use:

europe['france']

Here, 'france' is the key and 'paris' the value is returned.

Instructions

100 XP
  • Check out which keys are in europe by calling the keys() method on europe. Print out the result.
  • Print out the value that belongs to the key 'norway'.