This method is used to return true if one set contains all the items of another set that is being compared with it. Since it returns a value therefore original set remains unchanged and output is printed using another variable.
Variable = A.issuperset(B)
This method takes an argument.
- Set A is being taken
- Set B is being taken
- issuperset() method is being applied on set A with help of set B.
- output is printed inside C
- Returns true since A set contains all the items of B set
Note that if there is mismatch of even single item this method will return false.
- What is difference between issubset and issuperset method in python?
issubset() method returns true if an entire set is inside some other set or not, whereas issuperset() method returns true if a set contains some other sets entire item.