Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 16 Online
OpenStudy (littlebird):

Assume the availability of a function is_prime. Assume a variable n has been associated with positive integer. Write the statements needed to compute the sum of the first n prime numbers. The sum should be associated with the variable total. Note: is_prime takes an integer as a parameter and returns True if and only if that integer is prime.

OpenStudy (littlebird):

total=0 number = 0 n = 1 while number <= n: if is_prime(n) == True: total += n break (my attempt)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!