I am getting multiple lists as an output to a function. I want to combine all the lists and form only one list. Please help
def words(*args):
word =[args]
tokens = nltk.wordpunct_tokenize(''.join(word))
for word in tokens:
final = wn.synsets(word)
synonyms = set()
for synset in final:
for synwords in synset.lemma_names:
synonyms.add(synwords)
final = list(synonyms)
dic = dict(zip(word,final))
dic[word] = final
return final