Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Collections (2016, retired 2019) Dictionaries Introduction To Dictionaries

When creating a dictionary in a dictionary, the video dictionary is still there. Why is that?

Got confused as the video finished it. It shows that when he added teacher as a {}, why is video still included?

Thanks Stivan Radev def does help, was also confused that it was closed with two brackets and only one but testing helped though

1 Answer

Stivan Radev
Stivan Radev
1,475 Points

So, basically, he just added a new dictionary to the string teacher which is {"first_name": "Kenneth", "last_name": "Love"}. He did not touch the string videos, that is why the string videos is still included. The only thing that was affected was the string teacher.

Hopefully, this helped you in some way.

fady mohamed
fady mohamed
5,972 Points

I thought Mathew was referring to the fact that it looked like the videos key and value were being deleted in the console, which I believe is just a bug that makes it look like theyre being deleted but in fact are still there.