I've started assignment 2 by creating a test to see if a number is prime.
is_Prime = 4 #Declares a variable for the number to be tested
x=is_Prime #Sets the value x to the number being tested to act as the range
counter=0 #sets a variable named counter to zero
for i in range(1,x):
remainder = is_Prime%(x-1) #declares a variable named remainder and divides it by a value -1
if remainder == 0:
counter=counter+1 #if the remainder is = zero,then we add one to the counter
x=x-1
if counter>1:print "number not prime"
else:
print "number is prime"

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!

@bwca My apologies. Newbie here. :)

Yes it does work. Now I have to figure out how to put it in a loop to get to 1000th prime.

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.