Discuss / Python / 简化版

简化版

Topic source

def strim(s): while s!="" and s[0]==" ": s = s[1:] while s!="" and s[-1]==" ": s = s[:-1] return s


  • 1

Reply