Q:

Write a Python program to strip a set of characters from a string

0

Write a Python program to strip a set of characters from a string.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

def strip_chars(str, chars):
    return "".join(c for c in str if c not in chars)

print("\nOriginal String: ")
print("The quick brown fox jumps over the lazy dog.")
print("After stripping a,e,i,o,u")      
print(strip_chars("The quick brown fox jumps over the lazy dog.", "aeiou"))
print()

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now