for i, j in enumerate(wn.synsets('dog')):
    print('Meaning', i, 'NLTK ID:', j.name)
print('Hypernyms:', ', '.join(list(chain(*[l.lemma_names for l in j.
    hypernyms()]))))
print('Hyponyms:', ', '.join(list(chain(*[l.lemma_names for l in j.hyponyms
    ()]))))
print()
All synonyms for word in python?