input: Write a python function to calculate the accuracy score from a confusion matrix.
  assert calculate_accuracy([[2, 0], [1, 1]]) == 0.75
  assert calculate_accuracy([[5, 3], [2, 4]]) == 0.6923076923076923
  assert calculate_accuracy([[10, 0], [0, 10]]) == 1.0
output: def calculate_accuracy(confusion_matrix):
      total_correct = sum(confusion_matrix[i][i] for i in range(len(confusion_matrix)))
      total = sum(sum(row) for row in confusion_matrix)
      return total_correct / total if total else 0.0