Discuss / Python / 交作业

交作业

Topic source
if s == '':    return sif s[0] == ' ':    return trim(s[1:])else:    if s[-1] == ' ':        return trim(s[:-1])return s

if s == ' ':

    return s

if s[0] == ' ':

    return trim(s[1:])

else:

    if s[-1] == ' ':

        return trim(s[:-1])

return s


  • 1

Reply