[Tutor] Odd & Even lists

Cameron Simpson cs at cskk.id.au
Sat May 30 22:11:07 EDT 2020


On 30May2020 23:46, alexkleider <alexkleider at protonmail.com> wrote:
>On Saturday, May 30, 2020 4:15 PM, Cameron Simpson <cs at cskk.id.au> 
>wrote:
>> I think it is worth mentioning the enmerate() function here, a great 
>> way to get a sequence of (index,value) pairs from a list of values. This
>> makes Mary's test easier to do.
>
>I agree with the first statement but I don't understand how that helps 
>Mary with her problem. Can you elucidate?

Alas, no. I misread her requirements as a sort of unzip: put every other 
element into alternate lists (which would have cared about the indices), 
rather than picking the even and odd values. I blame the filter-as-XOR 
thread elsewhere for my confusion :-)

Thanks for the catch,
Cameron Simpson <cs at cskk.id.au>


More information about the Tutor mailing list