def trim(s): m = 0 n = len(s)-1 if s != " ": while m < len(s) and s[m] == " ": m = m+1 while n >= 0 and s[n] == " ": n = n-1 if m == len(s): s = "" else: s = s[m:n+1] else: s = "" return s
Sign in to make a reply
Perrylili