Getting the size of the set (size property)
Now, if we want to know the size of the set, which means how many elements are there in our set, then we can make use of the size property. Have a look at the below program, where we are trying to use the size property –
Size Property
If you try to have a look at the output, it looks something like this –
As you can see, the set contains 6 unique elements in it. So, the size of the set comes out to be 6. So, whenever we need the size of the set, we can make use of the size property for the given set, and get the size of the given set.