This function forms the required string
def reverseletter ( string , start , end ) : NEW_LINE INDENT wstart , wend = start , start NEW_LINE while wend < end : NEW_LINE INDENT if string [ wend ] == " ▁ " : NEW_LINE INDENT wend += 1 NEW_LINE continue NEW_LINE DEDENT DEDENT DEDENT