Question: write the following code in python 3.2+. Recursive function prefered. Thank you! Write a function named q4() that accepts a List as a parameter. The
write the following code in python 3.2+. Recursive function prefered. Thank you!

Write a function named q4() that accepts a List as a parameter. The q4() function 'rotates' or moves each value in the List up by one index position and the last value in the List is moved down to the first position. Finally the resulting List is returned. Example: Given the List [2, 4, 6, 8] the function would move the values 2, 4 and 6 to the next index position, 8 is moved to index [0] and the function returns the List [8, 2, 4, 6]. Some additional examples: ggg q4 (['b', 'y', 'q', 'i', 'n']) ['n', 'b', 'y', 'q', 'i'] ggg q4(['Jane', 'June', 'Jon', 'Joe']) ['Joe', 'Jane', 'June', 'Jon'] ggg q4([2.5, 5. 25, 7, 8. 25, 'Yay']) ['Yay', 2.5, 5.25, 7, 8.25]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
