as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
create a function to subtract two matrices.
user
def subtract_matrices(matrix1, matrix2):
    if len(matrix1) != len(matrix2) or len(matrix1[0]) != len(matrix2[0]):
        print('error! cannot subtract two matrices of different sizes!')
        return none 
    result = [[matrix1[i][j] - matrix2[i][j] 
              for j in range(len(matrix1[0]))] 
              for i in range(len(matrix1))] 
  
    return result
assistant