input: Write a function to compute the mean of numbers stored in an array. Return the mean value or 0 if the array is empty.
  assert calculate_mean([10, 20, 30])==20.0
  assert calculate_mean([0, 0, 0])==0.0
  assert calculate_mean([1, 2, 3, 4, 5])==3.0
  assert calculate_mean([])==0
  assert calculate_mean([-1, 0, 1])==0.0
output: def calculate_mean(arr):
      if not arr:
          return 0
      return sum(arr) / len(arr)