{"id":906,"date":"2015-03-17T08:48:34","date_gmt":"2015-03-17T08:48:34","guid":{"rendered":"https:\/\/fir3netwp.gmsrrpobkbd.com\/2015\/03\/17\/python-check-for-items-across-sets\/"},"modified":"2021-07-24T15:41:43","modified_gmt":"2021-07-24T15:41:43","slug":"python-check-for-items-across-sets","status":"publish","type":"post","link":"https:\/\/www.fir3net.com\/Programming\/Python\/python-check-for-items-across-sets.html","title":{"rendered":"Python – Check for Items across Sets"},"content":{"rendered":"
Within this example we will check if the same item exists across 2 sets. If so then a boolean is returned,<\/p>\n
>>> s1 = set([1, 2, 3])
>>> s2 = set([3, 4, 5])
>>> bool(set(s1) & set(s2))
True<\/pre>\n","protected":false},"excerpt":{"rendered":"Within this example we will check if the same item exists across 2 sets. If so then a boolean is returned, >>> s1 = set([1, 2, 3])>>> s2 = set([3, 4, 5])>>> bool(set(s1) & set(s2))True<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"yoast_head":"\n
Python - Check for Items across Sets - Fir3net<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n