I use python3.6 I want to delete the same string,and this is my code.
r = [['I1', 'I2'], ['I1', 'I3'], ['I1', 'I5'], ['I2', 'I3'], ['I2','I4'], ['I2', 'I5']]
for v in range(len(r)):
for k in range(v+1,len(r)):
union = list(set(r[v]) | set(r[k]))
print(sorted(union))
and results is:
['I1', 'I2', 'I3']
['I1', 'I2', 'I5']
['I1', 'I2', 'I3']
['I1', 'I2', 'I4']
['I1', 'I2', 'I5']
['I1', 'I3', 'I5']
['I1', 'I2', 'I3']
['I1', 'I2', 'I3', 'I4']
['I1', 'I2', 'I3', 'I5']
['I1', 'I2', 'I3', 'I5']
['I1', 'I2', 'I4', 'I5']
['I1', 'I2', 'I5']
['I2', 'I3', 'I4']
['I2', 'I3', 'I5']
['I2', 'I4', 'I5']
how can I delete the same string?