Can someone help me with "Editing Guide" problem of code coach?
Problem is as follows: Manipulating Strings You are making a text editor and need to implement find/replace functionality. The code declares a text string. You need to take two string inputs, which represent the substring to find and what to replace it with in the text. Your program needs to output the number of replacements made, along with the new text. For example, for the given text "I weigh 80 kilograms. He weighs 65 kilograms.": Sample Input kilograms kg Sample Output 2 I weigh 80 kg. He weighs 65 kg. The program replaced 2 occurrences of the word kilograms with kg. My Code text = "Amy has 128 dollars, while David has 54 dollars. Amy is going to the zoo. David watches soccer." lst = text.split() find = input() replace = input() #print(lst) count = 0 for x in lst: if x == find: ind = lst.index(x) lst.pop(ind) lst.insert(ind,replace) count+=1 string = " " string = string.join(lst) print(count) print(string) It is not passing all the test cases. Please help