FAQ: Creating Dictionaries - Review

This community-built FAQ covers the “Review” exercise from the lesson “Creating Dictionaries”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Computer Science

FAQs on the exercise Review

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

My solution is below. I found Step 5 really odd in this–it didn’t seem to build on top of steps 1-4 in any practical way, other than just another manipulation of lists. As a result, it took me a solid 10-15 minutes for what is actually a VERY simple step.

My hint for step five is take it very literally, you’re just defining a basic key:value i.e. “The Best Songs” : plays, …

songs = ["Like a Rolling Stone", "Satisfaction", "Imagine", "What's Going On", "Respect", "Good Vibrations"]
playcounts = [78, 29, 44, 21, 89, 5]

plays = {key:value for key, value in zip(songs, playcounts)}

#print(plays)

plays["Purple Haze"] = 1
plays["Respect"] =  94

print(plays)

library = {"The Best Songs": plays, "Sunday Feelings":{} }

print(library)

Did anyone else experience this issue: you do exactly what the solution gives, yet it throws errors back at you?