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
The second property of sets is that they do not contain duplicate data. Members are uniquely different from one another.
Second Property of Sets
Sets do not contain duplicate values.
Challenges
What are the results of the following expressions?
print(len({3, 2, 1, 2, 3, 1}))
print(len({'hello', 'hello', 'hello', 'sets!'}))
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
Members are uniquely
different from one another.
0:00
To demonstrate this, I'll create a new
set literal with some curly braces.
0:03
And each member of this set
literal is going to be an integer
0:09
separated by commas.
0:14
And I will repeat some of
these in no particular order.
0:16
And let's get this printed out as well.
0:24
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