Python Program to create a Set

# Different types of sets in Python
# set of integers
my_set = {1, 2, 3}
print(my_set)
# set of mixed datatypes
my_set = {1.0, "Hello", (1, 2, 3)}
print(my_set)

OUTPUT:

{1, 2, 3}
{1.0, (1, 2, 3), 'Hello'}

Sharing Is Caring

Leave a Comment