1。删除前后的空白字符
>>> str = “ a b c d “
>>> str.strip()
‘a b c d’
2。删除左边的空白
>>> str = “ a b c d “
>>> str.lstrip()
‘a b c d ‘
3。删除右边的空白
>>> str = “ a b c d “
>>> str.rstrip()
‘ a b c d’