Rüdiger Wolf wrote:
> I am trying to Process list elements as consecutive pairs into
> consecutive pairs.
> Any pythonic suggestions?
>
> listin = [1,2,3,4,5,6,7,8,9,10]
> I want to process as consecutive pairs
> 1,2
> 3,4
> 5,6
> 7,8
> 9,10
>>> listin = [1,2,3,4,5,6,7,8,9,10]
>>> it = iter(lis
On Fri, Mar 5, 2010 at 10:48 PM, Hugo Arts wrote:
>
> Except the OP requested pairs (1, 2), (3, 4), i.e. with no duplicate
> elements. Here is a generator that does what you need:
>
> def pairs(seq):
> it = iter(seq)
> try:
> while True:
> yield it.next(), it.next()
> ex
2010/3/5 Emad Nawfal (عمـ نوفل ـاد) :
>
>
> Here is a general solution that I also took from the Tutor list some time
> ago. It allows you to have consequences of (any) length.
>
def makeVectors(length, listname):
> ... """takes the length of the vector and a listname returns vectors"""
>
On Fri, Mar 5, 2010 at 1:03 PM, Wayne Werner wrote:
> On Fri, Mar 5, 2010 at 11:56 AM, Rüdiger Wolf <
> rudiger.w...@throughputfocus.com> wrote:
>
>> Hi
>>
>> I am trying to Process list elements as consecutive pairs into
>> consecutive pairs.
>> Any pythonic suggestions?
>>
>> listin = [1,2,3,4
On Fri, Mar 5, 2010 at 11:56 AM, Rüdiger Wolf <
rudiger.w...@throughputfocus.com> wrote:
> Hi
>
> I am trying to Process list elements as consecutive pairs into
> consecutive pairs.
> Any pythonic suggestions?
>
> listin = [1,2,3,4,5,6,7,8,9,10]
> I want to process as consecutive pairs
> 1,2
> 3,
On Fri, Mar 5, 2010 at 12:56 PM, Rüdiger Wolf <
rudiger.w...@throughputfocus.com> wrote:
> I am trying to Process list elements as consecutive pairs into
> consecutive pairs.
> Any pythonic suggestions?
>
> listin = [1,2,3,4,5,6,7,8,9,10]
> I want to process as consecutive pairs
> 1,2
> 3,4
> 5,6
Hi
I am trying to Process list elements as consecutive pairs into
consecutive pairs.
Any pythonic suggestions?
listin = [1,2,3,4,5,6,7,8,9,10]
I want to process as consecutive pairs
1,2
3,4
5,6
7,8
9,10
Thanks
Rudiger
___
Tutor maillist - Tutor@p