set()
` constructor :# create a set using the set() constructor
my_set = set([1, 2, 3, 4, 5])
# print the set
print(my_set)
In this example, we create a set called `my_set
` using the `set()
` constructor. We pass in a list of integers `[1, 2, 3, 4, 5]
` as an argument to the `set()
` constructor to create the set.
Then, we simply print the set using the `print()
` function.
{1, 2, 3, 4, 5}