I'm trying to understand when is preferred to use recursion rather than iteration.
Actually I've encounterencountered recursion only in Javascript but never in Python. I imagine that recursion should be used in determinate contexts or languages but I don't understand when I should use it and which advantages it gives me?.
I would like to see some examples of advantageous usage of recursion, as opposed to iteration.