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
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
here is my solution
Join our real-time social learning platform and learn together with your friends!