In short
Recursion is when a function calls itself to solve a smaller version of the same problem. Every recursive function needs a base case that stops the calls.
Yes, a function can call itself in Python. Think of the factorial: , and is the base case. Each call reduces the problem a little, until it reaches the base case, and the answers are then combined on the way back. Without a base case, Python stops the program with a RecursionError. A recursive check for a palindrome compares the first and last letters and then checks the middle.
This prints 120.
Also searched as: python can a function call itself, palindrome recursion python.
Python labs run in your browser. Type the code, run it and see what happens.
Open a Python lab