Question: In this assignment, you will write a function named replace(test_string, replace_string) that takes two strings as an input and returns a new string where the
In this assignment, you will write a function named replace(test_string, replace_string) that takes two strings as an input and returns a new string where the first occurrence of replace_string has been replaced by "bodega"
For example-
replace("Hi how are you?", "you") should return "Hi how are bodega?"
Notes:
1. string_1.find(string_2) finds the position of the first occurence of string_2
2. len(string) returns the length of the string
3. Do not use INPUT function inside the method, use the parameters
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
