A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 5 years ago

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?

  • This Question is Closed
  1. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I guess i should have comments in there so people can actually understand whats going on... but i dont.

  2. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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

  3. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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
  4. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.