checking the second condition
for j in range ( 1 , len ( temp ) - 1 ) : NEW_LINE INDENT if ( temp [ j ] - temp [ j - 1 ] > temp [ j + 1 ] - temp [ j ] ) : NEW_LINE INDENT flag = 1 NEW_LINE DEDENT DEDENT