n=len(s) i=0 j=-1 if n == 0: return s while i < n-1 : if s[i] == ' ': i = i + 1 else: #print(s) s=s[i:n] #print(s) break if i == n-1 : return "" while j > 1-n: if s[-1] != ' ': break if s[j] == ' ': j = j - 1 else: s=s[:j+1] break #print(s) return s
Sign in to make a reply
风庭水轩