Question: - Given the below error-free program, you are asked to answer the following questions: a- What will be the output? b- What does the function
- Given the below error-free program, you are asked to answer the following questions: a- What will be the output? b- What does the function try recursion do? Explain. def try recursion(k): if (k>0) : result =k+try recursion (k1) print (result, end=" ") else: result =0 return result print ("InRecursion Example Results") print ("In",try_recursion(6), sep="") Answer: a- The output: ( rks) Recursion Examp. desults 136101521 21 b- It sums up all the integers from n to 0 . ( 4 marks) Question 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
