anonymous
  • anonymous
I have been thinking about the primes problem in problem set 1 for a day now and this is all I have. check=3 iteration=20 while iteration>0: print("Checking:",check) for x in range(2,check): if check%x==0: print(x,"Not prime, moving on") if check%x>0: print(x,"Possible prime") iteration-=1 check+=1 Kinda interesting but definitely not where I need to be to solve the problem. And suggestions on where to go next?
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
I guess i should have comments in there so people can actually understand whats going on... but i dont.
anonymous
  • anonymous
OK where to start, i think your jumping ahead with your functions, problem set 1 should not use the for statement, as it needs to be paired with the return statement now your going to need three conditions (that I can think of) if something is prime (divisible only by 1 and itself) if something is obviously not prime (divisible by something other then one and itself) it its inconclusive (your test comes up with a remainder) keeping in mind you can create two parts for each test if x == y and y>z report back when you have something a little bit more on track or if you got lost with my explanation
anonymous
  • anonymous
I suppose I should catch up on the readings before I do this problem set. I didn't even know that the for command wasn't introduced. I was probably relying on examples I had looked at for help. After a couple minutes work, this is what I have:
1 Attachment

Looking for something else?

Not the answer you are looking for? Search for more explanations.