Answers for "Write a function filter_string(str1, str2) which returns a copy of str1 with all characters from str2 removed."

0

Write a function filter_string(str1, str2) which returns a copy of str1 with all characters from str2 removed.

def filter_string(str1, str2):
    for c in str2:
        str1 = str1.replace(c, '')
    return str1
Posted by: Guest on March-23-2021

Code answers related to "Write a function filter_string(str1, str2) which returns a copy of str1 with all characters from str2 removed."

Browse Popular Code Answers by Language