Intern — Middle
Testing the list reverse function
livecode
Task condition
It is necessary to write a test that checks the correctness of the reverse_list(elements: list) -> list function.
The function should:
- change the order of elements in the list to the opposite directly in the passed object;
- return exactly the same list object.
def reverse_list(elements: list) -> list:
elements.reverse()
return elements