Sets are used to store the unique values of any type.
Note that no duplicate values are displayed. Unique values are displayed.
And also note that sets are iterable objects. We have to iterate through the elements to display it.
Other useful methods:
In the above example, size is self-explanatory. There is another method ‘has’ which returns a boolean value based on whether the given element is present in the set or not.