I am working on the python script trying to create the excel file with columns in the following way:
a only
b only
c only
a and b but not in c
b and c but not in a
c and a but not in b
a and b and c.
The output would look like a 3 group venn diagram but i need in lists,and then i can export to excel spreadsheet.
list1 = ['ab','cd','gfa','eha','tu','asb','acd','cgf','ceh','dtu','ased','ra','re','sdgfsycbjs','jcjhcbsd']
list2 = ['abx','cd','gfr','eha','tu','asb','acl','cgfta','cpah','adtu','assa','fd','as','sbddsvc','jbcbh']
list3 = ['abs','cd','gfv','eh','tu','asb','ased','cgf','ceh','adtu','assa','qw','uy','hdsjb','bcjh']
a = []
b = []
c = []
ab = []
bc = []
ca = []
abc = []
for item in list1:
if item in list2:
if item in list3:
if item not in abc:
abc.append(item)
else:
ab.append(item)
else:
if item not in ca:
a.append(item)
for item in list2:
if item in list3:
if item in list1:
if item not in abc:
abc.append(item)
else:
bc.append(item)
else:
if item not in ab:
b.append(item)
for item in list3:
if item in list1:
if item in list2:
if item not in abc:
abc.append(item)
else:
ca.append(item)
else:
if item not in bc:
c.append(item)