Sets
Discover how to use sets for operations involving unique elements.
1
Introduction to Sets
Sets are unordered collections of unique items in Python. They are useful when you need to store unique elements and perform set operations like union, intersection, and difference.
In this lesson, you’ll learn how to create and manipulate sets, and perform common set operations.

2
Creating Sets
A set is created by placing items inside curly braces {}, separated by commas. For example:
# Creating a set
fruits = {"apple", "banana", "cherry"}
print(fruits)