Write code to reverse an array without using a rev function.
Implement def reverse_array(arr):. The function must reverse the input list in place and return the reversed list. Use only basic array operations and do not call Python's built-in reverse() or create a second array.
def reverse_array(arr):