xxxxxxxxxx
n = len({1, 2, 3})
# n = 3
or
myset = set()
myset.add(1)
myset.add(2)
myset.add(3)
len(set1)
# len(set1) = 3
xxxxxxxxxx
my_set = {1, 2, 3, 4, 5} # Example set
length = len(my_set) # Length of the set
print(length) # Output: 5
xxxxxxxxxx
# Create a set
my_set = {1, 2, 3, 4, 5}
# Find the length of the set
length = len(my_set)
print("Length of the set:", length)