Recursion is basically a function calling itself. Consider the function that you talked about:
def hellofunc():
print("Hello world!")
hellofunc()
Here, the function hellofunc() keeps printing "Hello world!" and calling itself indefinitely as you haven't specified any condition to break out of this.
Function calls are stored on the stack. So during recursion, the parent function call is pushed onto the stack everytime another hellofunc() is called.
Since you have not specified any limit or condition to break out of this, the maximum number of function calls placed on the stack is exceeded or in other words, the function calls stack reached it's maximum depth. This is called maximum recursion depth.
To prevent this, you could do something like:
def hellofunc(x):
if x <= 0:
return
print("Hello world!")
hellofunc(x-1)
If you do
hellofunc(4)
The output would be:
"Hello world!"
"Hello world!"
"Hello world!"
"Hello world!"
Hope this helps!