# 方法一s = ' abc 123 'print s.strip() # 去掉兩端的空格print s.lstrip() # 去掉左端的空格print s.rstrip() # 去掉右端的空格s = '-