Recursion in Python3
Could please someone explain me how a recursion works? I've found an example: def tri_recursion(x): if x>0: result = x + tri_recursion(x-1) print (result) else: result=0 return result tri_recursion(6) I tested this code and modified it, but I don't understand HOW is the function calling itself (result = x + tri_recursion(x-1)???) Also, what is the role of the else statement? These are my 2 questions about recursion. The other lines of code seem ok to me. Thanks in advance!