Python Set - issuperset method

The issuperset method exposed of the Python set class finds whether a set is superset of another set.

Set Updated 15 Sep 2016 1 min read

Method Name

issuperset(anotherSetObject_in)

Method Overview

Determines whether a set is a superset of another set passed as the parameter .

Parameters

anotherSetObject_in: A Python set is checked whether it is the superset of this parameter.

Example

python
# Example Python program that finds whether

            # a set is a super set of a given set

            animals          = {"Protozoa", "Insects","Fish","Amphibians","Reptiles"}

            invertebrates     = {"Protozoa", "Insects"}

            result = animals.issuperset(invertebrates)

            print(result)

Output

Output
True