def trim(s):
if len(s)==0: return s while s[0:1]==' ': s=s[1:] if len(s)==0: return s while s[-1]==' ': s=s[:-1] return s
Sign in to make a reply
爱回娘家吃饭的咸菜哥
-- coding: utf-8 --
def trim(s):
if len(s)==0:
return s while s[0:1]==' ': s=s[1:] if len(s)==0: return s while s[-1]==' ': s=s[:-1] return s