Peter Otten
1/23/2008 6:32:00 PM
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