Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Python Sets!
You have completed Python Sets!
Preview
Let's bring it all together with some more practice with the main set operations!
Code examples
# What do both omelets have in common?
denver.intersection(bacon)
denver & bacon
# What is unique to one of the omelets?
denver.difference(bacon)
denver - bacon
# What is unique to the other omelet?
bacon.difference(denver)
bacon - denver
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
I know that was a lot all at once and
I hope that my examples helped you out.
0:00
And remember that I have teacher's
notes for you below the video.
0:01
I have an exercise so that we can
practice more with some of these methods.
0:07
I cleaned up my script a little bit so
0:12
you can see our original five
sets of omelette ingredients.
0:14
For this exercise,
0:20
I'm going to be opening my script in
interactive mode or interpreter mode.
0:21
In the terminal we can invoke this
mode by running our script and
0:26
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up