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

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.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

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

Computer Science
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
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.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

numPrimes = 0 a = 3 while numPrimes <= 1000 if isprime( a ) numPrimes += 1 if numPrimes == 1000 print "We have 1000!" a += 2
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?

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Not the answer you are looking for?

Search for more explanations.

Ask your own question