def degree_nodes(adjacency_matrix, nnodes):
    """
    Compute the degree of each node and returns the list of degrees.

    :param adjacency_matrix: adjacency matrix
    :type adjacency_matrix: ndarray
    :param nnodes: number of nodes
    :type nnodes: int
    :return: list of degrees
    """
    degrees = []
    for i in range(nnodes):
        degrees.append(sum([adjacency_matrix[i][j] for j in range(nnodes)]))

    return degrees