<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with edges [('A', 'C', 0.5), ('A', 'B', 1.5), ('B', 'A', 0.3), ('B', 'C', 0.7), ('C', 'A', 0.8)], can you convert it into a right-stochastic graph using NetworkX where the sum of the weights of all the outgoing edges of each node is 1?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()
G.add_weighted_edges_from([('A', 'C', 0.5), ('A', 'B', 1.5), ('B', 'A', 0.3), ('B', 'C', 0.7), ('C', 'A', 0.8)])

# Make the graph right-stochastic (the sum of weights of outgoing edges for each node is 1)
stochastic_G = nx.stochastic_graph(G, copy=True)

# Print the edge weights of the new right-stochastic graph
for u, v, data in stochastic_G.edges(data=True):
    print(u, v, data['weight'])
<|EOT|>
