def trim(s):
if s == '':
return s
while len(s) > 0 and s[0] == ' ':
s = s[1:]
while len(s) > 0 and s[-1] == ' ':
s = s[:-1]
Sign in to make a reply
zzu阿殷
def trim(s):
if s == '':
return s
while len(s) > 0 and s[0] == ' ':
s = s[1:]
while len(s) > 0 and s[-1] == ' ':
s = s[:-1]
return s