Handling UnboundLocalError in RecursionHow to handle UnboundLocalError that may occur in recursive functions