I have a list with words out of different textfiles. When I sort this list out and clean them of duplicates I still see multiple words which are the soms but out of different text files, e.g. ['you', 'chainletter.txt'] and ['you', 'grail.txt'] My question is , how could I combine these to give the output ['you', 'chainletter.txt', 'grail.txt']
I'm currently using the following code: 'pearl' module:
def make_table(pairs):
import sort
import dup
sort = sort.merge_pairs(pairs)
nodup = dup.remove_dups(sort)
print(nodup)
return nodup
And i want my 'search engine' to display words like described above