Update,Delete Dictionary elements

PHOTO EMBED

Tue Nov 23 2021 11:26:48 GMT+0000 (Coordinated Universal Time)

Saved by @Sourabh ##dictionary ##update ##delete

# Definition of dictionary
europe = {'spain':'madrid', 'france':'paris', 'germany':'bonn',
          'norway':'oslo', 'italy':'rome', 'poland':'warsaw',
          'australia':'vienna' }

# Update capital of germany
europe['germany'] = 'berlin'

# Remove australia
del(europe['australia'])

# Print europe
print(europe)
content_copyCOPY

https://campus.datacamp.com/courses/intermediate-python/dictionaries-pandas?ex=7