Question: Python 3 I've built this function which is meant to shift a list a specified number of indices to the left, but it returns None

Python 3

I've built this function which is meant to shift a list a specified number of indices to the left, but it returns None with the given code. I would really appreciate any help.

Python 3 I've built this function which is meant to shift a

This code should print [3, 4, 5, 1, 2] but instead prints None. Thank you!

52. Edef shiftnTimes (integerArray, numShifts): o A 56 57 58 if numShifts > 0: integerArray.insert(0, integerArray.pop(-1)), shiftnTimes (integerArray, (numShifts - 1)), final list = integerArray.reverse(), return final_list e 60 61 62 63 1st = [1, 2, 3, 4, 5] num = 2 print(shiftNTimes(1st, num)) 64

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!