Tri Recursion In Python Problems