the following example demonstrates some simple set operations and their resultsnotice that the set object does not care that its members are not all of the same typeas long as they are all immutable if you try to use mutable object such as list or dictionaries in setyou will receive an unhashable type error hashable types all have hash value that does not change throughout the lifetime of the instance all built-in immutable types are hashable all built-in mutable types are not hashableso they cannot be used as elements of sets or keys to dictionaries notice also in the preceding code that when we print out the union of and there is only one element with the value 'abthis is natural property of sets in that they do not include duplicates in addition to these built-in methods there are number of other operations that we can perform on sets for exampleto test for membership of setuse the followingwe can loop through elements in set using the following