A community for students.
Here's the question you clicked on:
 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?
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

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0I guess i should have comments in there so people can actually understand whats going on... but i dont.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0OK 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
 5 years ago
Best ResponseYou've already chosen the best response.0I 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:
Ask your own question
Sign UpFind more explanations on OpenStudy
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
 Engagement 19 Mad Hatter
 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.