{"id":3402,"date":"2022-11-26T13:49:04","date_gmt":"2022-11-26T13:49:04","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=3402"},"modified":"2022-11-26T13:49:06","modified_gmt":"2022-11-26T13:49:06","slug":"python-set-isdisjoint","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/python-set-isdisjoint\/","title":{"rendered":"Python Set isdisjoint() Method with many examples"},"content":{"rendered":"<p style=\"text-align: center;\">Python Set isdisjoint<\/p>\n<p>Now, we are going to understand the isdisjoint method. If you are already familiar with what disjoint sets are, it is well and good, but even if things are new for you, do not worry, since we are going to study the concept from basics, so that you can simply follow along.<\/p>\n<p>Let\u2019s consider that there are two sets set1, and set2. Now, set1 and set2 are said to be disjoint sets, if they do not have any elements in common. So, the method isdisjoint is going to return True, if the two sets are disjoint, and otherwise, it is going to return False.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3403 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isdisjoint-METHOD.jpg\" alt=\"\" width=\"646\" height=\"88\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isdisjoint-METHOD.jpg 646w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/10\/THE-isdisjoint-METHOD-300x41.jpg 300w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/p>\n<h2 style=\"text-align: center;\">Python Set isdisjoint() Method<\/h2>\n<p>As you can see in the above program, we have two sets. So, we are then trying to check if the two sets are disjoint. In the above set, the output would be False, since these sets are not disjoint. The thing is that if the two sets are disjoint, they have no elements in common, which is not true in the above case, so the output is False.<\/p>\n<p>So, whenever we need to check if the two sets are disjoint or not, we can simply use the isdisjoint method. Remember that the two sets are disjoint when they do not have any elements in common.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python Set isdisjoint Now, we are going to understand the isdisjoint method. If you are already familiar with what disjoint sets are, it is well and good, but even if things are new for you, do not worry, since we are going to study the concept from basics, so that you can simply follow along. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[26,27],"class_list":{"0":"post-3402","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-python-tutorial","7":"tag-python","8":"tag-python-tutorial"},"_links":{"self":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/comments?post=3402"}],"version-history":[{"count":2,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3402\/revisions"}],"predecessor-version":[{"id":4111,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/3402\/revisions\/4111"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=3402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=3402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=3402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}