Run
def findPrimes(m, n): primes = [] for k in range(m,n): #check if k is a prime number i = 2 isPrime = True while i < (k / i): if k % i == 0: isPrime = False break i += 1 #if k is a prime number, append it to result list if isPrime: primes.append(k) return primes m = 5 n = 25 result = findPrimes(m, n) print(result)
Output