input: Write a function to calculate the mean of numbers stored in an array. If the array is empty, return 0.
  
  def calculate_mean(numbers):
      if not numbers:
          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([2, 4, 6, 8])==5.0
  assert calculate_mean([5, 5, 5])==5.0
  assert calculate_mean([])==0
output: def calculate_mean(numbers):
      if not numbers:
          return 0
      total_sum = 0
      for num in numbers:
          total_sum += num
      mean = total_sum / len(numbers)
      return mean