NetworkX graphs are Python objects. Print version and a two-edge path.
Goal
Create Nairobi—Nakuru—Kisumu and print nodes.
import networkx as nx
print(nx.__version__)
G = nx.Graph()
G.add_edge('Nairobi', 'Nakuru')
print(list(G.nodes()))import networkx as nx
G = nx.path_graph(['Nairobi', 'Nakuru', 'Kisumu'])
print(list(G.edges()))