<｜begin▁of▁sentence｜>### Instruction:
Generate a connected caveman graph using the networkx library, where the graph is comprised of l cliques, each containing k nodes. How would you print out the list of nodes and edges for this graph?
### Response:
import networkx as nx

# Generate a connected caveman graph with l cliques of size k
l = 3  # number of cliques
k = 4  # size of each clique

# Create the graph
G = nx.connected_caveman_graph(l, k)

# Optional: Convert to a directed graph
# G = nx.to_directed(G)

# Optional: Convert to a multigraph
# G = nx.MultiGraph(G)

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