input: Write a function to calculate the average of the elements in a 2-dimensional array. The function should iterate through all elements in the nested lists and compute their sum, then divide by the total number of elements to get the average.
  assert averageMatrix([[3,2,6],[8,5,9],[4,7,1]])==4.77
  assert averageMatrix([[1,1,1],[1,1,1],[1,1,1]])==1.0
  assert averageMatrix([[2,4],[6,8]])==5.0
  assert averageMatrix([[9,9],[9,9]])==9.0
  assert averageMatrix([[]])==0
output: def averageMatrix(matrix):
      total_sum = 0
      total_count = 0
      for row in matrix:
          total_sum += sum(row)
          total_count += len(row)
      if total_count == 0:
          return 0
      return round(total_sum / total_count, 2)