lstrip、rstrip和strip删除开头、末尾和两端的空格>>> x = ' hej ' >>> print '|', x.lstrip(), '|', x.rstrip(), '|', x.strip() | hej | hej | hej