Session Ready
Exercise

Dictionary Manipulation (1)

If you know how to access a dictionary, you can also assign a new value to it. To add a new key-value pair to europe you can use something like this:

europe['iceland'] = 'reykjavik'
Instructions
100 XP
  • Add the key 'italy' with the value 'rome' to europe.
  • To assert that 'italy' is now a key in europe, print out 'italy' in europe.
  • Add another key:value pair to europe: 'poland' is the key, 'warsaw' is the corresponding value.
  • Print out europe.