How to implement function like this?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Tue Oct 23 06:10:58 EDT 2007


On Tue, 23 Oct 2007 11:48:08 +0200, Loic Mahe wrote:

> even shorter:
> 
> def funcA(tarray):
>      s = min(len(tarray), 3)
>      return [2, 3, 4][0:s] + [e for e in funcB(3-s)[0:3-s]]

Why the list comprehension!?

Ciao,
	Marc 'Blackjack' Rintsch



More information about the Python-list mailing list