Implement a function in Python for finding the maximum element in an array.
list = [18, 25, 1, 12, 37]
def find_max(list):
    max_element = list[0]
    for element in list:
        if element > max_element:
            max_element = element
    return max_element

max = find_max(list)
print(max)