def trim(m): if m == ' ': return m elif m[0] == ' ' and len(m) > 0: s1 = m[1:] return trim(s1) elif m[-1] == ' ' and len(m) > 0: s2 = m[:-1] return trim(s2) else: return mm = input('one str:') a = trim(m) print(a)
Sign in to make a reply
Herman.