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

help with problem set 1? what is missing? primeList = [2] primeCandidate = 1 while len(primeList)<1000: primeCandidate = primeCandidate + 2 test = primeCandidate - 1 while test>2: while (primeCandidate%test)>0: test = test - 1 primeList.apppend(primeCandidate) if len(primeList) == 1000: print primeList[999]

OpenStudy (anonymous):

what isn't it doing? please use a code pasting site: dpaste.com. pastebin.com. codepad.org, ideone.com

OpenStudy (anonymous):

it doesn't display anything! http://dpaste.com/708752/

OpenStudy (anonymous):

Hi dextere here I made few modifications to your code: http://dpaste.com/708859/ Hope it helps!And try to solve probles sets according to calendar.Have a good day!

OpenStudy (anonymous):

after you run it and it doesn't print anything - primeList should still 'be available' for your inspection. how many items are in it? what is the last item? what is actually in primeList? those will give you clues to what is happening. if you are using a shell (like Idle) you should just be able to 'inspect' primeList using statements at the shell's prompt. while you are debugging, maybe set your limit to something more manageable like 10 instead of 1000.

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!