The function f(x) takes a word as input and applies a rule that replaces all occurrences of a certain letter in the word with another letter. For example, if the input word is "cat" and the letter to be replaced is "a", the output of the function would be "ct".
