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

Here's what I did for Prob set 1a. I created two functions, and it tests fine, however in order to use it in the shell if have to type primeList(n). Where primeList is the funcion I created and n I what number prime you would like. How do I switch this to just taking an input after a promt? http://codepad.org/8AdgBWhM

OpenStudy (anonymous):

I've seen that, however, I can't seem to get my input to run through my function listPrime

OpenStudy (anonymous):

Ok, I ended with this. It's not as elegant as I'd like, but it functions http://codepad.org/mauT4W0F

OpenStudy (anonymous):

To clean it up a bit you could do something like this: http://codepad.org/FQPFj0DV

OpenStudy (anonymous):

LyonsDF, For ps1, I don't think anyone can create an 'elegant' solution. I'm willing to bet that if you came back to it after doing ps5, you would easily discover the elegance you're seeking.

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!