Before I ask the question, this is what I have, I think it\'s near but no cigar
ID: 3644675 • Letter: B
Question
Before I ask the question, this is what I have, I think it's near but no cigar yet.
total = 0
for iterator in xrange(0, n):
....if (is_prime(iterator) == True):
........total += iterator
but i know the iterator should be gone.
If we assume the availbity of a function the_prime. Also assume a variable w is associated with a positive integer. I need to write the statements needed to compute the sum of the first w prime numbers. The sum should be associated with the variable total.
Also, the_prime takes an int as a parameter and it will return True only if the integer is prime.