Reverse the substarting after the last encountered opening bracket till the current character
elif ( strr [ i ] == ' ) ' ) : NEW_LINE INDENT temp = strr [ st [ - 1 ] : i + 1 ] NEW_LINE strr = strr [ : st [ - 1 ] ] + temp [ : : - 1 ] + strr [ i + 1 : ] NEW_LINE del st [ - 1 ] NEW_LINE DEDENT