### Recent Posts by Tutor

CS101 CodeLab Solutions

# CodeLab Solution 51828

Given a variable , province_premier, that is associated with a dictionary that maps the province names to the names of province premiers, associate with premier_province a dictionary that is the inverse of province_premier, i.e. one that maps names of premiers to province names.

...

CS101 CodeLab Solutions

# CodeLab Solution 51824

The variable planet_distances is associated with a dictionary that maps planet names to planetary distances from the sun. Write a statement that deletes the entry for the planet name "Pluto".

[cc lang="PYTHON"] del(planet_distances["Pluto"]) [/cc]

...
CS101 CodeLab Solutions

# CodeLab Solution 51821

Assume there is a variable , album_artists, that is associated with a dictionary that maps albums to performing artists. Write a statement that inserts the key/value pair: "Live It Out"/"Metric".

[cc lang="PYTHON"] album_artists["Live It Out"] = "Metric" [/cc]

...
CS101 CodeLab Solutions

# CodeLab Solution 51818

Given that d refers to a dictionary, change the value mapped to by the key 'Monty' to 'Python'.

[cc lang="PYTHON"] d['Monty']='Python' [/cc]

...