Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7018 > unrolled thread

Re: Lambda question

Started byVito 'ZeD' De Tullio <zak.mc.kraken@libero.it>
First post2011-06-04 21:34 +0200
Last post2011-06-04 21:34 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Lambda question Vito 'ZeD' De Tullio <zak.mc.kraken@libero.it> - 2011-06-04 21:34 +0200

#7018 — Re: Lambda question

FromVito 'ZeD' De Tullio <zak.mc.kraken@libero.it>
Date2011-06-04 21:34 +0200
SubjectRe: Lambda question
Message-ID<mailman.2457.1307216114.9059.python-list@python.org>
jyoung79@kc.rr.com wrote:

> I was surfing around looking for a way to split a list into equal
> sections.

non-recursive, same-unreadeable (worse?) one liner alternative:

def chunks(s, j):
    return [''.join(filter(None,c))for c in map(None,*(s[i::j]for i in 
range(j)))]


-- 
By ZeD

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web