<｜begin▁of▁sentence｜>### Instruction:
Given a lollipop graph where some edges have attributes 'weight' and 'capacity', how do you generate an edge list showing just the edge connections without data, an edge list with all edge data in dictionary format, and an edge list with selected edge data?
### Response:
import networkx as nx

# Create a lollipop graph
G = nx.lollipop_graph(4, 3)
# Add edge attributes
G[1][2]['weight'] = 3
G[3][4]['capacity'] = 12

# Generate edge list with no data
for line in nx.generate_edgelist(G, data=False):
    print(line)

# Output:
# 0 1
# 0 2
# 0 3
# 1 2
# 1 3
# 2 3
# 3 4
# 4 5
# 5 6

# Generate edge list with default data (dictionary format)
for line in nx.generate_edgelist(G):
    print(line)

# Output:
# 0 1 {}
# 0 2 {}
# 0 3 {}
# 1 2 {'weight': 3}
# 1 3 {}
# 2 3 {}
# 3 4 {'capacity': 12}
# 4 5 {}
# 5 6 {}

# Generate edge list with selected data keys
for line in nx.generate_edgelist(G, data=['weight']):
    print(line)

# Output:
# 0 1
# 0 2
# 0 3
# 1 2 3
# 1 3
# 2 3
# 3 4
# 4 5
# 5 6
<|EOT|>
