Discuss / Python / 交作业

交作业

Topic source

xinyujaychou

#1 Created at ... [Delete] [Delete and Lock User]

def trim(s): if len(s) == 0: return s elif s[:1] == " ": return trim(s[1:]) elif s[-1] == " ": return trim(s[:-1]) else: return s

用这段代码测试结果是失败的


  • 1

Reply