Некоторые варианты ответа @MarkByers:
>>> from collections import defaultdict
>>>
>>> terms = [
... 'Electronic rock', 'Alternative rock', 'Indie pop',
... 'baa baa black sheep',
... 'Blackpool rock', # definition of "equality"?
... 'Rock of ages',
... ]
>>>
>>> def process1():
... d = defaultdict(list)
... for term in terms:
... for word in term.split():
... d[word].append(term)
... for k,v in d.iteritems():
... if len(v) > 1:
... print k,v
...
>>> def process2():
... d = defaultdict(set)
... for term in terms:
... for word in term.split():
... d[word.lower()].add(term)
... for k,v in d.iteritems():
... if len(v) > 1:
... print k, sorted(list(v))
...
>>> process1()
rock ['Electronic rock', 'Alternative rock', 'Blackpool rock']
baa ['baa baa black sheep', 'baa baa black sheep']
>>> process2()
rock ['Alternative rock', 'Blackpool rock', 'Electronic rock', 'Rock of ages']
>>>