<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with edge set [('A', 'B', weight=1.5), ('B', 'C', weight=2.5), ('A', 'C', weight=4.0)], compute the shortest path length and predecessors starting from node 'A' using NetworkX's `dijkstra_predecessor_and_distance` function.
### Response:
import networkx as nx

# Create a weighted directed graph
G = nx.DiGraph()
G.add_weighted_edge('A', 'B', weight=1.5)
G.add_weighted_edge('B', 'C', weight=2.5)
G.add_weighted_edge('A', 'C', weight=4.0)

# Compute the shortest path length and predecessors
# starting from node 'A'
pred, dist = nx.dijkstra_predecessor_and_distance(G, source='A')

# Display the dictionaries of predecessors and distances
print('Predecessors:', pred)
print('Distances:', dist)
<|EOT|>
