def trim(s): if s!='': while s[0]==' ' and s!=' ': s=s[1:] while s[-1]==' ' and s!=' ': s=s[:-2] if s==' ': s='' return s
Sign in to make a reply
旅行的第欧根尼
def trim(s): if s!='': while s[0]==' ' and s!=' ': s=s[1:]
while s[-1]==' ' and s!=' ': s=s[:-2] if s==' ': s='' return s