input: Write a function to find the average of numbers stored in an array. If the array is empty return 0.
  
  def calculate_mean(numbers):
      if len(numbers) == 0:
          return 0
      total_sum = 0
      for num in numbers:
          total_sum += num
      mean = total_sum / len(numbers)
      return mean
  
  assert calculate_mean([10, 20, 30]) == 20.0
  assert calculate_mean([]) == 0
output: def calculate_mean(numbers):
      if len(numbers) == 0:
          return 0
      total_sum = 0
      for num in numbers:
          total_sum += num
      mean = total_sum / len(numbers)
      return mean