checked = [False] * len(words)
for i, (word, word_s) in enumerate(words):
    if checked[i]:
        continue
for j, (other, other_s) in enumerate(words[i:]):
    if word_s == other_s:
        print(other, end=' ')
checked[i + j] = True
print()
Как думать на Python после работы на C++?