input: 
  from typing import List
  
  
  def add_matrix(matrix1: List[List[float]], matrix2: List[List[float]]) -> List[List[float]]:
      """
      Adds two matrices if they have the same dimensions.
  
      >>> add_matrix([[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]])
      [[6.0, 8.0], [10.0, 12.0]]
      >>> add_matrix([[1.0, 2.0], [3.0, 4.0]], [[1.0, 2.0]])
      'Matrices not compatible'
      """
      if len(matrix1) != len(matrix2) or len(matrix1[0]) != len(matrix2[0]):
          return 'Matrices not compatible'
  
      return [[matrix1[i][j] + matrix2[i][j] for j in range(len(matrix1[0]))] for i in range(len(matrix1))]
  
output:     if len(matrix1) != len(matrix2) or len(matrix1[0]) != len(matrix2[0]):
          return 'Matrices not compatible'
  
      return [[matrix1[i][j] + matrix2[i][j] for j in range(len(matrix1[0]))] for i in range(len(matrix1))]