def pendantNodes(G):
    """
    Given a graph G, finds it's pendant nodes and
    the edge connecting them to another node.

    INPUT
    G: A networkx graph

    OUTPUT
    pendant: A list of the format [[vertex, edge] ... ]
    """
    nodes = G.nodes()
    pendant = []
    for node in nodes:
        if G.degree(node) == 1:
            pendant.append([node, G.edges(node)[0]])
    return pendant
