If there are multiple occurrences of the words to be swapped in the string, we can choose which two specific words to swap in the list method (because it uses the index to swap) but the replace() function method will swap every occurrence of word1 with word2 and vice-versa, that is, it will not work if we want to swap only specific occurrences of the words.