Function to build sieve
def buildSieve ( ) : NEW_LINE INDENT for i in range ( len ( sieve ) ) : NEW_LINE INDENT sieve [ i ] = True NEW_LINE DEDENT sieve [ 0 ] = False NEW_LINE sieve [ 1 ] = False NEW_LINE p = 2 NEW_LINE while p * p <= 1000000 : NEW_LINE DEDENT