check degree of node in networkx code example Example: get node degree networkx G.degree[0] # return node 0 degree