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

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

# Get a list of nodes
nodes = list(G.nodes())
print('The nodes in the graph are:', nodes)
<|EOT|>
