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