Recursive Lambda Function Python