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,4
> 5,6
> 7,8
> 9,10
>

for x in xrange(0, len(listin), 2):
    print listin[x], listin[x+1]

- that's probably how I'd do it anyway.

HTH,
Wayne
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to