<｜begin▁of▁sentence｜>### Instruction:
Given a GraphML string representing an undirected graph with two nodes and one edge, how can one use NetworkX to parse this string and create a NetworkX graph object, then print the number of nodes and edges the graph has?
### Response:
import networkx as nx

# GraphML string
graphml_string = '''
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
   http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <graph id="G" edgedefault="undirected">
    <node id="1"/>
    <node id="2"/>
    <edge id="3" source="1" target="2"/>
  </graph>
</graphml>
'''

# Parse the GraphML string
G = nx.parse_graphml(graphml_string, node_type=str, edge_key_type=int)

print('Graph has', G.number_of_nodes(), 'nodes and', G.number_of_edges(), 'edges')
<|EOT|>
