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!

does it work? please use a code pasting site to post your code http://dpaste.com/675763/ http://pastebin.com/qT1Hyd9K http://codepad.org/3lzUfYsa .... there are others

@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.