Discuss / Python / 练习

练习

Topic source

無淣

#1 Created at ... [Delete] [Delete and Lock User]

def trim(s):

if len(s)==0:

return s

if s[0]==' ' or s[0]=='/t':

s=trim(s[1:])

if s[-1]==' ' or s[-1]=='/t':

s=trim(s[:-1])

return s


  • 1

Reply