Dictionary Manipulation (2)
Somebody thought it would be funny to mess with your accurately generated dictionary. An adapted version of the europe dictionary is available in the script.
Can you clean up? Do not do this by adapting the definition of europe, but by adding Python commands to the script to update and remove key:value pairs.
Diese Übung ist Teil des Kurses
Intermediate Python
Anleitung zur Übung
- The capital of Germany is not
'bonn'; it's'berlin'. Update its value. - Australia is not in Europe, Austria is! Remove the key
'australia'fromeurope. - Print out
europeto see if your cleaning work paid off.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Definition of dictionary
europe = {'spain':'madrid', 'france':'paris', 'germany':'bonn',
'norway':'oslo', 'italy':'rome', 'poland':'warsaw',
'australia':'vienna' }
# Update capital of germany
# Remove australia
# Print europe