Discuss / Python / 切片

切片

Topic source

七月上行

#1 Created at ... [Delete] [Delete and Lock User]
if len(s) == 0:
    return s
if s[0] == ' ':
    return trim(s[1:])
if s[-1] == ' ':
    return trim(s[:-1])
return s

递归大法好


  • 1

Reply