Marking the multiples as false
for i in range ( n ) : NEW_LINE INDENT if ( v [ a [ i ] ] == False ) : NEW_LINE INDENT continue NEW_LINE DEDENT for j in range ( 2 * a [ i ] , len + 1 , a [ i ] ) : NEW_LINE INDENT v [ j ] = False NEW_LINE DEDENT DEDENT