As per http://docs.python.org/2/library/string.html
string.replace(s, old, new[, maxreplace]) Return a copy of string s
with all occurrences of substring old replaced by new. If the optional
argument maxreplace is given, the first maxreplace occurrences are
replaced.
Your code should thus be modified to:
def replaceWord(oldWord,newWord,aStr):
return aStr.replace(oldWord,newWord)
This difference being that yours did not catch the returned (new) string from the replace function.
Ideally thought you should just use aStr.replace(oldWord,newWord) without wrapping it in a function. There would be less overhead that way, and it makes the code clearer.
If you want it to only replace the first word you can add the third, optional, parameter which is the number of replacements to do.
str.replace(old, new[, max]),max -- If this optional argument max is given, only the first count occurrences are replaced