Microsoft interview question

Implement Python .replace(..) method