Find the position of 4
for i in range ( len ( string ) ) : NEW_LINE INDENT if ( string [ i ] == '4' ) : NEW_LINE INDENT string [ i ] = '3' ; NEW_LINE a += '1' ; NEW_LINE flag = 1 ; NEW_LINE DEDENT DEDENT