
By default, str.strip in Python removes leading/trailing whitespace:
s = ' a b c '
s.strip() # returns 'a b c'
It takes an optional argument, naming leading/trailing characters to remove. Great for cleaning strings:
s = '"Hello!"'
s.strip(string.punctuation) # 'Hello'
