<｜begin▁of▁sentence｜>### Instruction:
Suppose you need to create a star graph where there is one central node and 3 outer nodes, all connected to the central node. How would you use NetworkX's star_graph function to generate this graph, and how can you display its nodes and edges?
### Response:
import networkx as nx

# Use the star_graph API to create a star graph with 3 outer nodes connected to a center node.
# n is the number of outer nodes.
n = 3
# Create the star graph
star = nx.star_graph(n)

# Print nodes and edges of the star graph
print('Nodes:', star.nodes())
print('Edges:', star.edges())
<|EOT|>
