Answers for "disjoint set python"

0

disjoint set python

# Python3 program for isdisjoint() function
  
set1 = {2, 4, 5, 6} 
set2 = {7, 8, 9, 10}
set3 = {1, 2}
  
  
#checking of disjoint of two sets
print("set1 and set2 are disjoint?", set1.isdisjoint(set2))
  
print("set1 and set3 are disjoint?", set1.isdisjoint(set3))
Posted by: Guest on August-14-2021

Python Answers by Framework

Browse Popular Code Answers by Language