Question: Write a Python program that replaces all occurrences of a given word in a file with another given word. Hint: The string method someString.replace(abc, bac)
Write a Python program that replaces all occurrences of a given word in a file with another given word. Hint: The string method someString.replace(abc, bac) returns a string where all occurences of the substring abc in the original string someString is replaced by the substring bac .
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
