Welcome

sampleqa.in tutorials, python tutorial

Python tutorial


Python FrozenSet Methods

methoddescription
unionall elements from both sets
intersectionelements exists in both sets
differenceset1-set2, i.e elements from set1, which are not in set2
symetric_difference
issubsetreturns True, when set1 elements contained in set2
issupersetreturns True when set2 all elements are contained in set2
isdisjoint
copydoes shallow-copy

Set Remove and discard methods

    Both methods are used to remove a element from the Set object.
discard method removes element if found, otherwise do nothing
remove methood also removes element if found, otherwise KeyError exception thrown

ADS