<｜begin▁of▁sentence｜>### Instruction:
How do you add a cycle to an existing graph in NetworkX, and how can you also include edge attributes such as weights?
### Response:
import networkx as nx

# Create an empty graph
G = nx.Graph()

# Add a simple cycle with 4 nodes to the graph
nx.add_cycle(G, [0, 1, 2, 3])

# Add another cycle with 3 nodes where each edge has a weight of 7
nx.add_cycle(G, [10, 11, 12], weight=7)

# Print the edges to see the weights
print(G.edges(data=True))
<|EOT|>
