<｜begin▁of▁sentence｜>### Instruction:
Given a graph whose edge set is [('A', 'B'), ('B', 'C'), ('C', 'D')], can you convert the node labels to consecutive integers starting from 0, while preserving the node order from the original graph and storing the original labels in a node attribute?
### Response:
import networkx as nx

# Create a graph with non-integer labels
G = nx.Graph()
G.add_edge('A', 'B')
G.add_edge('B', 'C')
G.add_edge('C', 'D')

# Convert node labels to integers starting from 0
H = nx.convert_node_labels_to_integers(G, first_label=0, ordering='default', label_attribute='old_label')

# Print the nodes of the new graph
print('Nodes of H:', H.nodes(data=True))
# Output should be something like: Nodes of H: [(0, {'old_label': 'A'}), (1, {'old_label': 'B'}), (2, {'old_label': 'C'}), (3, {'old_label': 'D'})]
<|EOT|>
