有没有更好的方法来编写这个函数?
def highest_strength(G):
highest_strength = None
highest_strength_val = 1
for node1 in G:
for node2 in G[node1]:
val = G[node1][node2]
if val > highest_strength_val:
highest_strength_val = val
highest_strength = (node1, node2)
return highest_strength