Table of Contents
Definition
This method returns true if two set has no common items, else it returns false. Since, it returns a value therefore original set remains unchanged.
Syntax
Variable = A.isdisjoint(B)
This method takes argument
Working
Code
- Set A is being taken
- Set B is being taken
- isdisjoint() method is being applied to set A with the help of set B
- Returned value is printed inside C
Output
- Output is True. Since both sets has no common items.
Interview Questions
- How will you find if two sets are completely distinct?
We can find if two sets are completely distinct or not by using isdisjoint() method.