input: Write a function to find the average of numbers stored in an array. The function should return the average of the numbers. If the array is empty, the function should return 0.
  
  assert calculate_mean([10, 20, 30])==20.0
  assert calculate_mean([5, 15, 25, 35])==20.0
  assert calculate_mean([])==0
  assert calculate_mean([2])==2.0
  assert calculate_mean([-10, 10])==0.0
output: def calculate_mean(arr):
      if not arr:
          return 0
      return sum(arr) / len(arr)