Question: 5 points Status: Not Submitted - def remove_all_from_string(word, letter): for i in word: if i == letter: num = word.find(letter) word = word[:num] + word[num+1:]

5 points Status: Not Submitted - def remove_all_from_string(word, letter): for i in word: if i == letter: num = word.find(letter) word = word[:num] + word[num+1:] print word print remove_all_from_string("hello", "1") Write a function called remove_all_from_string that takes two strings, and returns a copy of the first string with all instances of the second string removed. You can assume that the second string is only one letter, like "a". Test your function on the strings "hello" and "1". Print the result, which should be: heo You must use: A function definition with parameters. A while loop. The find method. Slicing and the + operator. A return statement
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
