Python Learning: Automate Boring Stuff with Python | Solution to Part II Chapter 7 Practice Project II
import re #first argument – string to be stripped #second argument – char or default ” ” def customStrip(string: str, stripChar: str=”\s”)->str: ”’ Removes specified character from the beginning and end of a given string arguments: string: str stripChar: str returns: string ”’ if stripChar == “” or stripChar == ” “: stripChar = “\s” […]