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

any answers for ps1b, I'm not sure I'm right?

OpenStudy (anonymous):

https://gist.github.com/926240

OpenStudy (anonymous):

A very interesting approach. The only issue I have with it is the apriori knowledge you have to have to know that the 1000th prime is less than 8000. Can you correct the code so you no longer require that information?

OpenStudy (anonymous):

Good point, I'll give it a shot. Are the print statements (lines 31-33) along the right lines - have I understood the question correctly?

OpenStudy (anonymous):

Yeah, those are fine.

OpenStudy (anonymous):

Thanks for the response so far, appreciated. I have come up with a solution that removes the "prior knowledge" problem. See https://gist.github.com/937869. This code could be more efficient, but do you think I have reached a stage where I should continue on to the next assignment yet? Many thanks, Joe

OpenStudy (anonymous):

Lol, very nice. You hardly need this course ;p

OpenStudy (anonymous):

Cool, I'm going to keep going, that one took me hours!

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!