PS 1.2 - The last three lines of my code doesn't seem to be executing. I was wondering if somebody could help me with this. Thanks in advance.
import math
#Variables
n = input('Enter a prime number: ')
counter = 0
candidate = n
divisor = 2
primelist = [2]
sum = 0
while candidate != 0:
while candidate % divisor != 0:
divisor += 1
if divisor == candidate:
primelist.append(candidate)
print primelist
candidate -= 2
counter += 1
divisor = 2
else:
candidate -= 2
divisor = 2
for num in primelist:
sum = sum + num

Hey! We 've verified this expert answer for you, click below to unlock the details :)

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

For some reason it didn't post all the code the first time. Sorry about that

Looking for something else?

Not the answer you are looking for? Search for more explanations.

## More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.