Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Python and a while loop only, Write code that takes a string and a substring from the user, and removes all instances of the
Using Python and a while loop only,
Write code 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.
Template:
def remove(string, sub): string = string sub = sub #YOUR CODE GOES HERE (indented) return [] #END YOUR CODE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started