Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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.


Explanation / Answer

def the_prime(w): total = 0 flag = 0 count = 0 a=1 while (count
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote