Colab

s = "the quick brown fox jumped over the lazy dog"
words = s.split()

result = []
for word in words:
    result.append(word.upper() if word in ['fox', 'dog'] else word)

result

['the', 'quick', 'brown', 'FOX', 'jumped', 'over', 'the', 'lazy', 'DOG']
for i, word in enumerate(words):
    if word in ['fox', 'dog']: words[i] = word.upper()