Write a function in Python that takes a list of numbers as an input, and returns the largest of them.
[1, 2, 3, 4, 5]
def largest(list):
 largest = 0
 for number in list:
 if number > largest:
 largest = number
 return largest

print(largest([1, 2, 3, 4, 5]))
# Outputs 5