Sets in Python are used to store multiple items in a single variable. They are one of Python's built-in data types for storing collections of data. A set is a collection which is unordered and unindexed, and does not allow duplicate values.
Sets are created by placing items inside curly braces {}.
my_set = {"apple", "banana", "cherry"}Elements in a set can be accessed by iterating over it.
for item in my_set:
print(item)Sets are mutable, meaning you can add and remove items.
my_set.add("orange")
print(my_set)