i'm trying to give the shortest path a diffrent color than the rest of the edges but it doent work as all the edges come out with the same color
color_list = []
for i in G.edges():
if i in shortestpath: # if edges is the shortest path color with red
color_list.append("red")
else: # other wise color green
color_list.append("Green")
print('c_list',color_list)
print(shortestpath)
#output:(3, 0, 1)
print(G.edges)
#output:[(0, 1), (0, 3), (1, 2), (2, 3), (3, 4)]
weight=nx.get_edge_attributes(G,'weight')
pos=nx.get_node_attributes(G,'pos')
nx.draw_networkx_edge_labels(G,pos,edge_labels=weight)
nx.draw(G,pos,with_labels=weight)
nx.draw_networkx_edges(G,pos,edge_color=color_list)
plt.show()
so my desired output is the path (3,0,1) to be colored differently like this :

