Write code to reverse the elements of an array in Python.
def reverseArray(list): 
    start = 0
    end = len(list) - 1
    while start < end:
        list[start], list[end] = list[end], list[start]
        start += 1
        end -= 1
    return list