我正在嘗試迭代列表的兩個連續元素。如何在python中迭代列表中的兩個連續元素?
mentionedlist=[[1,2,3,4][1,2,3,4][2,3,4,5][3,4,5,5][1,2,3,4][1,2,3,4][]]
現在我想在列表的天氣第一個元素比較在mentionedlist一張表的mentionedlist和第一個元素是一樣的,我也希望做整個列表中的這些比較。
[1,2,3,4][1,2,3,4] is example of answer that i am expecting.
你想''1,2,3,4] [1,2,3,4]'然後'[2,3,4,5] [3,4,5,5]'然後''[ 1,2,3,4] [1,2,3,4]'?或者你想''1,2,3,4] [1,2,3,4]'然後'[1,2,3,4] [2,3,4,5]'然後'[2, 3,4,5] [3,4,5,5]'...? – 2013-05-04 02:14:01
我想[1,2,3,4] [1,2,3,4]然後[2,3,4,5] [3,4,5,5]然後[1,2,3,4] [1,2,3,4] – 2013-05-04 04:01:30