: This method returns the starting index of the first occurrence of letter . If it isn't found, it returns -1 .
def remove_all_from_string(word, letter): return word.replace(letter, "") Use code with caution. Copied to clipboard 7.6 / 10 123...
: If letter is an empty string, the loop would run forever; we return the original word immediately. : This method returns the starting index of