Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   




issuperset( ) FUNCTION


The 'issuperset( )' Function takes the values from both the Sets and checks if all the values from Set 2 is also present in Set 1.


Let us understand with the below example.


Example :


x = {"Kriti", "Sia"}
y = {"Sia", "Andrew", "Kriti"}
z = x.issuperset(y)
print(z)          


Output :



  False

So, in the above code we have created a 'Set' and put the names, 'Kriti' and 'Sia' to the variable 'x'.


x = {"Kriti", "Sia"}

java_Collections

Next, we have put the names, 'Sia', 'Andrew' and 'Kriti' in another set 'y'.


y = {"Sia", "Andrew", "Kriti"}

java_Collections

And used the 'issuperset( )' Function next.


z = x.issuperset(y)

And since, all the elements of Set 'y'(i.e. 'Kriti', 'Sia' and 'Andrew') is not present in the Set 'x', 'issuperset( )' returns False.


java_Collections

And we get the below output,


False