if len(s)!=0:
while s[:1]==" ":
s=s[1:]
while s[-1:]==" ":
s=s[:-1]
return s
正解!
要是不只一个空格就不对了
Sign in to make a reply
天沢
if len(s)!=0:
while s[:1]==" ":
s=s[1:]
while s[-1:]==" ":
s=s[:-1]
return s