Jul-11-2018, 01:59 PM
You could add:
Also, you call find_maxPrimes (which gets the maximum getNumPrimes) and find_maxPrimes2 (which prints all the getNumPrimes), so you are calculating all of the getNumPrimes twice. If you just added the print statement from find_maxPrimes2 to find_maxPrimes, you do it all at the same time.
if i < 2: return FalseHowever, note that you are checking the same numbers over and over again to see whether they are prime. I would instead find all the primes up to 10000 and put them in a set. Then you can just check each number to see if it is in the set.
Also, you call find_maxPrimes (which gets the maximum getNumPrimes) and find_maxPrimes2 (which prints all the getNumPrimes), so you are calculating all of the getNumPrimes twice. If you just added the print statement from find_maxPrimes2 to find_maxPrimes, you do it all at the same time.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures