I can\'t figure out why this python function returns None if it calls itself recursively.
It was part of my solution to a Project Euler problem. I have solved the p
Notice that you are making recursive calls to the next_prime function, but not returning the value from it from the calling function.
Replace the lines:
print candidate, "is not prime - divisible by", div
next_prime(candidate)
with
print candidate, "is not prime - divisible by", div
return next_prime(candidate)