<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with the edge set [(1, 2), (2, 3), (3, 4)], can you check if the graph is semiconnected using the is_semiconnected function from NetworkX?
### Response:
import networkx as nx

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

# Check if the graph is semiconnected
semiconnected = nx.is_semiconnected(G)
print('The graph is semiconnected:', semiconnected)
<|EOT|>
