replacement = ['firstthe', 'secondthe']
sentence = 'This is the first sentence in the whole universe!'
words = sentence.split()
counter = 0
for i, word in enumerate(words):
    if word == 'the':
        words[i] = replacement[counter]
counter += 1
sentence = ' '.join(words)
Replacing each match with a different word