2015-10-14 35 views

回答

0

不管用什麼語言,你都可以使用地圖。在蟒蛇它會是什麼樣子:

map(lambda x: x[0] + x[1], my_list) 

或者更簡單:

map(sum, my_list) 

兩個返回:

[5, 9, 5]