The point is that replace can only replace 1 word(as your example) or 1 character.
So if word is
Have to call replace two times.
Here a hint.
So if word is
apple
can't write replace('ae', '')
Have to call replace two times.
>>> text = 'apple' >>> a = text.replace('a', '') >>> a 'pple' >>> b = a.replace('e', '') >>> b 'ppl'But using replace is unnecessary and only make the task more difficult than it is.
Here a hint.
>>> text = 'apple' >>> letters = [] >>> for char in text: ... if char not in 'aeiou': ... letters.append(char) ... >>> letters ['p', 'p', 'l'] >>> ''.join(letters) 'ppl'