I\'m supposed to create a function, which input is a list and two numbers, the function reverses the sublist which its place is indicated by the two numbers. for example this is
lst[::-1] is the idiomatic way to reverse a list in Python, The following show how and that it was in-place:
lst[::-1]
>>> lst = [1, 2, 3, 4, 5] >>> id(lst) 12229328 >>> lst[:] = lst[::-1] >>> lst [5, 4, 3, 2, 1] >>> id(lst) 12229328