<｜begin▁of▁sentence｜>### Instruction:
Given a graph with the edge set [(1, 2), (1, 3), (2, 4), (2, 5)], can you determine if the graph is a tree using NetworkX? What if an edge is added between nodes 3 and 4?
### Response:
import networkx as nx

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

# Check if G is a tree
is_tree = nx.is_tree(G)
print('G is a tree:', is_tree)

# Add another edge that creates a cycle
G.add_edge(3, 4)

# Check if G is still a tree
is_tree = nx.is_tree(G)
print('G is still a tree after adding an edge:', is_tree)
<|EOT|>
