tmp = ['laughing ugh']
for t in tmp:
    words = t.split()
for i in range(len(words)):
    if words[i] in list(word_list.keys()):
        words[i] = word_list[words[i]]
newline = ' '.join(words)
print(newline)
Python string replacement