Python strip() – How to Trim a String or Line
When you specify as arguments . and !, all instances of both will get removed:
phrase = ".....Python !!!"
stripped_phrase = phrase.strip(".!")
print(stripped_phrase)
#output
#Python
When you specify as arguments . and !, all instances of both will get removed:
phrase = ".....Python !!!"
stripped_phrase = phrase.strip(".!")
print(stripped_phrase)
#output
#Python