<｜begin▁of▁sentence｜>### Instruction:
Given a weighted directed graph with nodes A, B, C, D, and E, where edges have the following weights: A to B (weight = 2), B to C (weight = 1), A to C (weight = 5), C to D (weight = 3), and D to E (weight = 4), what is the shortest path length from node A to all other nodes using the 'single_source_bellman_ford_path_length' function from NetworkX?
### Response:
import networkx as nx

# Create a weighted graph
G = nx.DiGraph()
G.add_edge('A', 'B', weight=2)
G.add_edge('B', 'C', weight=1)
G.add_edge('A', 'C', weight=5)
G.add_edge('C', 'D', weight=3)
G.add_edge('D', 'E', weight=4)

# Compute the shortest path length from source to all other reachable nodes
length = nx.single_source_bellman_ford_path_length(G, 'A', weight='weight')

# Print the shortest path length to each node
for node in length:
  print(f"{node}: {length[node]}")
<|EOT|>
