Discuss / Python / Python 递归函数切片

Python 递归函数切片

def trim(s):

 if s[0]==' ':

  s=s[1:]

 if s[-1]==' ':

  s=s[:-1]

  return s


  • 1

Reply