Tri Recursion In Python Definition