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
I've seen that, however, I can't seem to get my input to run through my function listPrime
Ok, I ended with this. It's not as elegant as I'd like, but it functions http://codepad.org/mauT4W0F
To clean it up a bit you could do something like this: http://codepad.org/FQPFj0DV
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.
Join our real-time social learning platform and learn together with your friends!