I don't understand your meaning, sir, respectfully. I believe the reason it returns None can only be for ONE REASON, based on his code. That it meets the
elif condition BUT does NOT meet the
if condition within it (OR it does not meet the
range, which should be range(2, x - 1)). Therefore, it has already ran a 'branch' of your 'tree', and satisfied its parameter(s) so it does not continue forward, since it stops running once it has completed/fulfilled ANY ONE OF YOUR THREE CONDITIONS. In this case, the only one I can see that could result in None would be the
elif (but x is either not within the
range specified or not meeting the
if condition). By the way, this won't solve the problem, but consider the second argument in the range and whether it needs to be modified based on the instructions..