Loops, Lists
Reverse a list in-place. Remember, for this to be “in-place” it can only use a small, constant amount of extra storage space, so no duplicating the list!
For example:
>>> lst = [1, 2, 3]
>>> rev_list_in_place(lst)
>>> lst
[3, 2, 1]
We’ve provided a file, revlistinplace.py, and a placeholder function, rev_list_in_place.
def rev_list_in_place(lst):
"""Reverse list in place.
You cannot do this with reversed(), .reverse(), or list slice
assignment!
"""
Implement rev_list_in_place.