<｜begin▁of▁sentence｜>### Instruction:
Given a graph whose edges have an attribute named 'color', how would you retrieve the color attribute for each edge, and provide a default color for edges without a specified color using NetworkX?
### Response:
import networkx as nx

# Create a graph
G = nx.Graph()

# Add paths with a 'color' attribute
nx.add_path(G, [1, 2, 3], color='red')
G.add_edge(3, 4, color='blue')

# Get edge attributes by specifying the attribute name
color = nx.get_edge_attributes(G, 'color')

# Output the color attribute of edge (1, 2)
print('The color of edge (1, 2) is:', color[(1, 2)])

# Try to get a color attribute for an edge without this attribute, using a default value
print('The color of edge (2, 3) with default is:', color.get((2, 3), 'yellow'))
<|EOT|>
