<｜begin▁of▁sentence｜>### Instruction:
Imagine we're organizing a community event, and we've mapped out a network of tasks that need collaboration among volunteers. The connections between tasks are as follows: [(1, 2), (2, 3), (3, 1), (3, 4), (4, 1)]. We need each task to be equally interdependent, meaning each should be paired with exactly two other tasks. Could you, as our helpful coordinator, use NetworkX to verify if the task network we've outlined exhibits this equal pairing, making it a 2-regular graph? This way, we can ensure a balanced workload for our volunteers.
### Response:
import networkx as nx

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

# Check if the graph is k-regular
k = 2
is_regular = nx.is_k_regular(G, k)
print(f'Is the graph k-regular with k={k}? {is_regular}')
<|EOT|>
