Given a list of numbers, write a function in Python that returns the average of the numbers.
[4, 2, 6, 8, 10]
def average_list(list):
 total = 0
 for item in list:
  total += item
 return total / len(list)

list = [4,2,6,8,10]
print(average_list(list)) # Output: 6.0