<｜begin▁of▁sentence｜>### Instruction:
Given a graph whose edge set is [('A', 'B'), ('B', 'C'), ('C', 'D')], can you provide a list of edges that only involve the nodes ['A', 'B', 'C'] using NetworkX?
### Response:
import networkx as nx

# Create a graph
G = nx.Graph()
G.add_edges_from([('A', 'B'), ('B', 'C'), ('C', 'D')])

# Generate edge list
edge_list = nx.to_edgelist(G, nodelist=['A', 'B', 'C'])

# Print edge list
for edge in edge_list:
    print(edge)
<|EOT|>
