recursion eventually fill up the run-time stack and you will get stack overflow error when running such program to prevent recursive function from running foreveror overflowing the runtime stackevery recursive function must have base casejust like an inductive proof must have base case there are many similarities between inductive proofs and recursive functions the base case in recursive function must be written firstbefore the function is called recursively nowwrapping your head around just how recursive function works is little difficult at first actuallyunderstanding how recursive function works isn' all that important when writing recursive functions we want to think more about what it does than how it works it doesn' pay to think too hard about how recursive functions workbut in fact even that will get much easier with some practice when writing recursive function there are four rules that you adhere to these rules are not negotiable and will ensure that your recursive function will eventually finish if you memorize and learn to follow these rules you will be writing recursive functions in no time the rules are decide on the name of your function and the arguments that must be passed to it to complete its work as well as what value the function should return write the base case for your recursive function first the base case is an if statement that handles very simple case in the recursive function by returning value finallyyou must call the function recursively with an argument or arguments that are smaller in some way than the parameters that were passed to the function when the last call was made the argument or arguments that get smaller are the same argument or arguments you examined in your base case look at concrete example pick some values to try out with your recursive function trust that the recursive call you made in the last step works take the result from that recursive call and use it to form the result you want your function to return use the concrete example to help you see how to form that result we'll do very simple example to begin with in the last we proved the following ( = soif we wanted to compute the sum of the first integerswe could write python program as shown in sect sum of integers def sumfirstn( )return ( + / def main()this copy belongs to 'acha