Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write Python code using a double while loop that takes a string and a substring

ID: 3705995 • Letter: W

Question

Write Python code using a double while loop that takes a string and a substring from the user, and removes all instances of the substring, returning that new resultant string.
You may not use any built-in functions/methods besides len() and .append(). Specifically, you may NOT use the replace() method.

def remove(s1, s2):

string = s1
sub = s2


#YOUR CODE GOES HERE (indented)

return ""
#END YOUR CODE

Write Python code using a double while loop that takes a string and a substring from the user, and removes all instances of the substring, returning that new resultant string.
You may not use any built-in functions/methods besides len() and .append(). Specifically, you may NOT use the replace() method.

def remove(s1, s2):

string = s1
sub = s2


#YOUR CODE GOES HERE (indented)

return ""
#END YOUR CODE

Explanation / Answer

def remove(s1, s2): string = s1 sub = s2 i = 0 result = '' while i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote