IN PYTHON Write a function that removes all occurrences of agiven letter from a string: 1 2 3 4 5 6 test(remove_letter(“a”,”apple”) == “pple”) test(remove_letter(“a”, “banana”) == “bnn”)test(remove_letter(“z”, “banana”) == “banana”)test(remove_letter(“i”, “Mississippi”) == “Msssspp”)test(remove_letter(“b”, “”) = “”) test(remove_letter(“b”, “c”) =”c”) PYTHON PLEASE
Solution
def remove_letter(ch, string): res = ” for c in string: if c != ch: res += c return res