def rec_count (number):
print (number)
Base case
if number == 0:
return
rec_count (number - 1) # A recursive call with a different argument
print (number)
rec_count (5)
=================================================================
In the above program, at one point, rec_count(0) is called recursively. In this call, we first print the number as ‘0’ then we go to the line below,
if number == 0,
return
In the above line the condition is fulfilled, hence ‘None’ is returned.
I am not able to understand how after that
1
2
3
4
5
is printed ?