【发布时间】:2015-05-03 16:11:23
【问题描述】:
我有一个方法,作为参数,我输入一个点的 x 和 y 坐标,然后计算从其他点到达该 [x,y] 坐标的功率,并按照从最高功率到最低的顺序对它们进行排序:
def power_at_each_point(x_cord, y_cord):
nodez_list = [nodes_in_room for nodes_in_room in range(1, len(Node_Positions_Ascending) + 1)]
powers_list = []
for each_node in nodez_list:
powers_list.append(cal_pow_rec_plandwall(each_node, [x_cord, y_cord]))
return max(powers_list)
我想以像key = cal_pow_rec_plandwall 这样的更 Python 的方式来做到这一点,但这种方法需要两个参数而不是一个。
那我该怎么做呢?
【问题讨论】: