Python: Strip a set of characters from a string
Strip specific characters from string.
Write a Python program to strip a set of characters from a string.
Sample Solution:
Python Code:
Sample Output:
Original String: The quick brown fox jumps over the lazy dog. After stripping a,e,i,o,u Th qck brwn fx jmps vr th lzy dg.
Flowchart:
For more Practice: Solve these Related Problems:
- Write a Python program to strip a set of specified characters from both the beginning and end of a string.
- Write a Python program to implement a function that removes given characters from a string using str.strip().
- Write a Python program to use regular expressions to remove all occurrences of a specific set of characters from the ends of a string.
- Write a Python program to manually remove unwanted characters from a string by iterating over its characters.
Go to:
Previous: Write a Python program to reverse words in a string.
Next: Write apython program to count repeated characters in a string.
Python Code Editor:
Contribute your code and comments through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.