I created the following function:
def test_recursion(x):
print(x)
while x < 10:
test_recursion(x+1)
test_recursion(x+2)
print("end of function reached")
test_recursion(1)
What I don't understand is why after x reaches 10 and the end of function print statement is reached, it keeps printing 11 then 10 in an infinite loop.
Should the program not end after 10 is printed?