def trim(s):
if s=='':
return s
else:
while s!='' and s[0]==' ':
s=s[1:]
while s!='' and s[-1]==' ':
s=s[:-1]
Sign in to make a reply
用户6329855348
def trim(s):
if s=='':
return s
else:
while s!='' and s[0]==' ':
s=s[1:]
while s!='' and s[-1]==' ':
s=s[:-1]
return s