<｜begin▁of▁sentence｜>### Instruction:
Given a graph whose edge set is [(1, 2), (1, 3), (2, 3), (3, 4), (4, 5)], can you create a subgraph that includes only the nodes [2, 3, 4] and show its edge set using NetworkX?
### Response:
import networkx as nx

# Create a graph
G = nx.Graph()
G.add_edges_from([(1, 2), (1, 3), (2, 3), (3, 4), (4, 5)])

# Define a list of nodes to create a subgraph
nbunch = [2, 3, 4]

# Create the subgraph
H = G.subgraph(nbunch)

# Print the edges of the subgraph
print(list(H.edges()))
<|EOT|>
