Python Is It Possible To Stop This Recursive Function

Python Is It Possible To Stop This Recursive Function