Question: write the following code in python 3.2+. Recursive function prefered. Thank you! A friend is struggling to write a Python function named q6()that accepts a

write the following code in python 3.2+. Recursive function prefered. Thank you!

write the following code in python 3.2+. Recursive function prefered. Thank you!

A friend is struggling to write a Python function named q6()that accepts a List as a parameter, reverses it and returns the modified List. The function currently reads: def q6 (lst): return q6 (lst [1:] + lst [0] When executed, Python displays the following: ggg q6 (["Roberta", "Susanne", "George", "Abigail"]) Traceback (most recent call last) File "", line 1, in ? File "", line 2, in q6 File "", line 2, in q6 ellipsis File "", line 2 in q6 RuntimeError: maximum recursion depth exceeded Modify the q6() function so that it works correctly. You may rewrite it as either a recursive function or using a loop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!