# How to create a dictionary of countries in America and their capitals?
america = {'Country': 'Capital', 'Canada': 'Ottawa', 'Mexico':'Ciudad de México', 'United States':'Washington, D.C'}
# Print countries in America and their capitals
print(america)
# How to get the capital of Mexico?
# use the keys inside a [] instedd of the index as in lists and tuples
# the countries are the keys while the capitals are the values
print(america['Country'])
print(america['Mexico'])
# How to get the capital of Mexico? We can also use .get()
print(america.get('Country'))
print(america.get('Mexico'))
# How to know the keys in a dictionary?
print(america.keys())
# How to know the values in a dictionary?
print(america.values())
# How to know the items in a dictionary?
print(america.items())
# How many items (key-value pairs) are in a dictionary?
len(america)
# How to change the capital of Canada?
america['Canada'] = 'Toronto'
print(america)
# How to add Brazil and its capital to America?
america['Brazil'] = 'Brasília'
print(america)
# How to delete the United States from America?
del america['United States']
print(america)