Complete the following python code to make it comply with the given logic
def largest_element(list1): 
    max = list1[0] 
    for item in list1: 
        if max
def largest_element(list1): 
    max = list1[0] 
    for item in list1: 
        if item > max: 
            max = item
    return max