A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • 5 years ago

need help with P1. here's what I've figured out so far but I don't know how to call for the 1000th number. help? def isprime(startnumber): startnumber*=1.0 for divisor in range(2,int(startnumber**0.5)+1): if startnumber/divisor==int(startnumber/divisor): return False return True for a in range(2,10000): if isprime(a): print a

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

    numPrimes = 0 a = 3 while numPrimes <= 1000 if isprime( a ) numPrimes += 1 if numPrimes == 1000 print "We have 1000!" a += 2

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

    I've just finished lecture 2 and looking at P1 and the tips, I think we need to isolate the odd numbers first and then figure out a method to test whether the odd number is a prime number. How do you test a number whether it is a prime?

  3. 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...


  • 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.