summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/README.rst b/README.rst
index f28fb8a9..7f5224e6 100644
--- a/README.rst
+++ b/README.rst
@@ -27,15 +27,15 @@ Simple example
Find the shortest path between two nodes in an undirected graph:
-.. code:: python
+.. code:: pycon
>>> import networkx as nx
>>> G = nx.Graph()
- >>> G.add_edge('A', 'B', weight=4)
- >>> G.add_edge('B', 'D', weight=2)
- >>> G.add_edge('A', 'C', weight=3)
- >>> G.add_edge('C', 'D', weight=4)
- >>> nx.shortest_path(G, 'A', 'D', weight='weight')
+ >>> G.add_edge("A", "B", weight=4)
+ >>> G.add_edge("B", "D", weight=2)
+ >>> G.add_edge("A", "C", weight=3)
+ >>> G.add_edge("C", "D", weight=4)
+ >>> nx.shortest_path(G, "A", "D", weight="weight")
['A', 'B', 'D']
Install