If top is 0 , append the same operator
if ( s [ - 1 ] == 0 ) : NEW_LINE INDENT res [ index ] = ' + ' NEW_LINE index += 1 NEW_LINE DEDENT elif ( Str [ i ] == ' - ' ) : NEW_LINE if ( s [ - 1 ] == 1 ) : NEW_LINE INDENT res [ index ] = ' + ' NEW_LINE index += 1 NEW_LINE DEDENT elif ( s [ - 1 ] == 0 ) : NEW_LINE INDENT res [ index ] = ' - ' NEW_LINE index += 1 NEW_LINE DEDENT elif ( Str [ i ] == ' ( ' and i > 0 ) : NEW_LINE if ( Str [ i - 1 ] == ' - ' ) : NEW_LINE