Discuss / Python / 嗯嗯

嗯嗯

Topic source

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


  • 1

Reply