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