input: Write a python function to calculate the average of a list of numbers.
  assert average([2, 3, 4, 5, 6]) == 4.0
  assert average([10, 20, 30, 40, 50]) == 30.0
  assert average([]) == 0
output: def average(numbers):
      if not numbers:
          return 0
      return sum(numbers) / len(numbers)