循环列表列表

时间:2011-07-02 22:57:47

标签: python

我该怎么做:coord + float(y) - float(x)

out = [[ coord - float(y) for v in V ] for y in y_coord ] 
out = [[ coord + float(x) for v in V ] for x in x_coord ] 

1 个答案:

答案 0 :(得分:3)

out = [[coord + float(y) - float(x) for v in V] for x,y in zip(x_coord, y_coord)]