On Mon, 17 Dec 2007 06:20:23 -0800, vimal wrote:

>    i have a list of numbers
> 
>   say a = [1,-1,3,-2,4,-6]
> 
>   how should i check for negative values in the list

In [6]: a = [1, -1, 3, -2, 4, -6]

In [7]: any(n < 0 for n in a)
Out[7]: True

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to