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

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

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