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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!