def trim(s):
if len(s)==0:
return s
elif len(s)!=0:
if s[0:1]==' ':
return trim(s[1:])
elif s[-1:]==' ':
return trim(s[:-1])
print(s)
Sign in to make a reply
机智豆_RD
def trim(s):
if len(s)==0:
return s
elif len(s)!=0:
if s[0:1]==' ':
return trim(s[1:])
elif s[-1:]==' ':
return trim(s[:-1])
print(s)