Discuss / Python / return s[start:end]

return s[start:end]

Topic source

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

start = 0

    end = len(s)

    while start < end and s[start] == ' ':

        start += 1

    while start < end and s[end - 1] == ' ':

        end -= 1

    return s[start:end]


  • 1

Reply