<｜begin▁of▁sentence｜>### Instruction:
Given a graph with the edges (1, 2), (1, 3), and (3, 4), can you use NetworkX to check if the graph is connected?
### Response:
import networkx as nx

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

# Check if the graph is connected
is_connected = nx.is_connected(G)
print(f'Is the graph connected? {is_connected}')
<|EOT|>
