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

I was wondering if anyone can check my solution to ps2 problem (McNuggets) I have been trying to get this optimized but am not sure I am handling it the right way. I am sure the output is correct so the program is working. http://pastebin.com/UbMe0MPj

OpenStudy (anonymous):

same thing but different - with for loops http://dpaste.com/696595/

OpenStudy (anonymous):

here is my solution to the finding prime number problem the only bug is it goes to -1 but im satisfied def prime(x, z): assert x> 0 assert z>= 0 while x > z: x = x-1 while x == 2 or x == 3 or x == 5 or x == 7 or x == 0: print x, 'is prime' x = x-1 if x%2==0 or x%3== 0 or x%5==0 or x%7==0: print x, 'is not prime' else: print x, 'is prime' if x is 0: print None return None

OpenStudy (anonymous):

here is my solution

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!