{"id":25053,"date":"2021-11-10T09:37:44","date_gmt":"2021-11-10T04:07:44","guid":{"rendered":"https:\/\/python-programs.com\/?p=25053"},"modified":"2021-11-10T09:37:44","modified_gmt":"2021-11-10T04:07:44","slug":"python-set-isdisjoint-method-with-examples","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-set-isdisjoint-method-with-examples\/","title":{"rendered":"Python Set isdisjoint() Method with Examples"},"content":{"rendered":"
Prerequisite:<\/h5>\n

Python set() Function with Examples<\/span><\/a><\/p>\n

Set isdisjoint() Method in Python:<\/strong><\/p>\n

If none of the items are present in both sets, the isdisjoint() method returns true; otherwise, it returns False.<\/p>\n

If two sets have no common elements, they are said to be disjoint.<\/p>\n

For Example<\/p>\n

p={1,2,3,4}<\/p>\n

q={5,6,7}<\/p>\n

Here p and q are said to be disjoint since they have no common elements.<\/p>\n

Syntax:<\/strong><\/p>\n

set.isdisjoint(set)<\/pre>\n

Parameters<\/strong><\/p>\n

set:<\/strong> This is Required. The set to look for items that are similar.<\/p>\n

Return Value:<\/strong><\/p>\n

This method returns<\/p>\n