Python set isdisjoint || Sets || Python
In this we are going to see a basic program which checks whether two sets are disjoint or not in Python Programming Language.


# Disjoint Is A Condition When Two Sets Are Not Intersecting

set1 = {"Mango", "Apple", "Grapes", "Cherry", "Pineapple", "Banana"}
set2 = {"Custurd", "Papaya", "Carrot", "Kiwi"}
print("Set1 : ", set1)
print("Set2 : ", set2)

# For Checking Whether Two Sets Are Disjoint
if set1.isdisjoint(set2):
    print("Two Sets Are Disjoint")
else:
    print("Two Sets Are Not Disjoint")

# Coded By DHIRAJ SHELKE


#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post