Write code to reverse an array without using a rev function.
Implement 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 the built-in reverse() or create a second array.
def reverse_array(arr):