Write a program to replace a word by an another word in a string. Both the words are entered by the user.
python program
Answers
Answered by
0
Answer:
Explanation:
The idea is to traverse the original string and count the number of times old word occurs in the string. Now make a new string of sufficient size so that new word can be replaced. Now copy original string to new string with replacement of word.
Similar questions