Re: Want to Use filter() with multi-variable function

DAVEGOTTNER@DELPHI.COM (davegott@news.delphi.com)
28 Jul 1994 06:07:02 -0000

templon@paramount.nikhefk.nikhef.nl (Jeffrey Templon) writes:

>Hi,

>I have a list of numbers; I want a quick and efficient way to
>find the subset of these numbers which lie between two limits.
>However these numbers are determined within the program itself.

> if a >= b and a < c :

How about

newlist = filter(lambda x, l=<expr1>, h=<expr2>: l <= x < h, oldlist)

(This was the primary motivation for default arguments: to pass context
for lambda)