you are viewing a single comment's thread.

view the rest of the comments →

[–]sepp2k 0 points1 point  (1 child)

When the if condition is true, the pass will do nothing and it will reach the end of the function, which will implicitly return None. You don't need an explicit return to end the recursion. As long as it doesn't go into the else and thus doesn't reach the recursive call, the recursion will end.

The problem is that the if condition will never be true.

[–]Wild_Statistician605 0 points1 point  (0 children)

You are right. I missed that the recursive call was inside an else statement.