user
Create a program that finds the largest element in an array
[2, 4, 6, 8, 10]

Response:
assistant
"""
Write a program that finds the largest element in an array
"""

def largest_element(arr):
    max_element = arr[0]
    
    for element in arr:
        if element > max_element:
            max_element = element
            
    return max_element

if __name__ == '__main__':
    arr = [2,4,6,8,10]
    print('The largest element in the array is ', largest_element(arr))