Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 9 Online
OpenStudy (anonymous):

I attempt problem 2 and got it to run by using the range function but finding the 1000th prime number is what i have troubles with. Do i have to add another branch to get the 1000th prime number part? Also for the range do is there a way to put infinity so the computer can keep going until it reached 1000th or is there no way?

OpenStudy (anonymous):

Post your code http://www.codepad.org

OpenStudy (anonymous):

You may use looping constructs to find the 1000th prime

OpenStudy (anonymous):

you could re-structure your code to use a while loop instead of a for loop. http://docs.python.org/tutorial/introduction.html#first-steps-towards-programming it helps to write down what you want to do first. something like: while number_of_primes_found < 1000 find another prime increment number_of_primes_found return or print the last prime that was found

OpenStudy (anonymous):

I generated all odd numbers through 8000, then tested weather they were prime keeping count until 1000.

OpenStudy (anonymous):

sorry for the late response everyone who post but here is the code Thank all of you for the help and time

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!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
1 day ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
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!