def trim(s):
while len(s) > 0:
if s[0] == ' ':
s = s[1:]
elif s[-1] == ' ':
s = s[:-1]
else:
return s
Sign in to make a reply
丑得惊动中南海
def trim(s):
while len(s) > 0:
if s[0] == ' ':
s = s[1:]
elif s[-1] == ' ':
s = s[:-1]
else:
return s
return s