Try changing primes = primes_gen(number)
to primes = primes_gen(number+1)
in first function and see if it works. Or try changing the i < limit
condition to i <= limit
in the second function.
Also, why are you deleting the 0th and 1st element in primes_gen method
? Is it because of values you get for 0, 1
? In which case, you can initialize with i=2
.