input: Write a function to calculate the mean (average) of numbers stored in an array. The function should take a list of numbers as input and return the average of those numbers. If the array is empty, the function should return 0.
  
  assert calculate_mean([10, 20, 30])==20
  assert calculate_mean([5, 15, 25, 35])==20
  assert calculate_mean([1])==1
  assert calculate_mean([])==0
output: def calculate_mean(numbers):
      if not numbers:
          return 0
      return sum(numbers) / len(numbers)