Discuss / Python / my home work

my home work

Topic source
def trim(s):
    if s == None or s == '':
        return ''
    if s != '' and s[0] ==' ':
        s = trim(s[1:])
    if s != '' and s[-1]==' ':
        s = trim(s[:-1])
    return s

  • 1

Reply