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 Comprehensions

Question about fizzbuzzes['fizzbuzz']

Hello!

Right in the end Kenneth writes:

fizzbuzzes['fizzbuzz'] = {n for n in fizzbuzzes['fizz'].intersection(fizzbuzzes['buzz'])}

I can understand the part which comes after the single equal sign but before that - why fizzbuzzes['fizzbuzz'] ?

Does he create a new key there with this or ... ?

Many thanks Ave Nurme

1 Answer

Steven Parker
Steven Parker
231,126 Points

You are exactly right, that creates a new key. In the very next step, he displays the set of values stored at that key.

Thank you very much, Steven, for your quick answer! Started to doubt myself there for a second...