Example #1
0
 def createPrimeNumbersList(self, totalNumbers):
     listOfPrimes = []
     primeNumber = 2
     for i in range(0,totalNumbers):
         while not isPrime(primeNumber):
             primeNumber += 1
         listOfPrimes.insert(i, primeNumber)
         primeNumber += 1
     return listOfPrimes
Example #2
0
def getListOfPrimes(high):
    myList = []
    for i in range(2, high):
        if isPrime(i):
            myList.append(i)
    return sumOfAList(myList)