<｜begin▁of▁sentence｜>### Instruction:
Given three nodes in a graph, how would you add an edge between the first and second node while also defining a 'label' attribute with the value 'A' and a 'weight' attribute with the value 2.0?
### Response:
import igraph as ig

# Create an empty graph
g = ig.Graph()

# Add vertices to the graph
g.add_vertices(3)

# Add an edge with a specified weight attribute#g.add_edge(0, 1, weight=1.5)
# Now adding an edge between vertex 0 and vertex 1 with attribute
g.add_edge(0, 1, label='A', weight=2.0)

# Print the edge list with attributes
print(g.get_edgelist())
print(g.es['label']) # Retrieve 'label' attribute of all edges
print(g.es['weight']) # Retrieve 'weight' attribute of all edges
<|EOT|>
