Question: I'm not sure why for the second function I get this output. Why is it printing 11, 7,5,3,2 def rp2( L, i ): if
I'm not sure why for the second function I get this output. Why is it printing 11, 7,5,3,2
def rp2( L, i ):
if i < len(L):
rp2( L, i+1 )
print(L[i], end=' ')
else:
print()
L = [ 2, 3, 5, 7, 11 ]
rp2(L,0).
Step by Step Solution
There are 3 Steps involved in it
The rp2 function is a recursive function that prints the elements of a list L in reverse order Lets ... View full answer
Get step-by-step solutions from verified subject matter experts
