#避免越界用s[:1]替代s[0] while s[:1] == ' ': s = s[1:] while s[-1:] == ' ': s = s[:-1] return s
避免越界是什么意思?不太明白为什么这里不能用s[0]
Sign in to make a reply
TN