def trim(s): if s == "" or s == " ": return "" elif s[0] == " ": s = s[1:] return trim(s) elif s[-1] == " ": s = s[:-1] return trim(s) else: return s
输入时为 python 格式,评论后就没有格式了?
Sign in to make a reply
90丶无悔