Generate a python function to find the largest number from the given list
[10, 20, 40, 19]
def largest_number(list):
    largest = list[0]
    for number in list:
        if number > largest:
            largest = number
    return largest