Matthew_WARREN wrote:

> I'm just fiddling with this, am no great expert, but I added
> 
> def pairs5(x):
>         o=[]
>         for n in zip(x[::2],x[1:2]):

The second argument should be x[1::2].

>                 o.append(n)
>         return o
> 
> I dont know if that breaks any constraints placed on the problem, but I

It breaks the constraints unless the above is not cut-n-paste ;)
Also note that your pairs5() offers no advantage over

def pairs6(x):
    return zip(x[::2], x[1::2])

Peter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to