thanks for your help Tim and Marc.
:)
--
http://mail.python.org/mailman/listinfo/python-list
> i am new to python guys.
>i have a list of numbers
>
> say a = [1,-1,3,-2,4,-6]
>
> how should i check for negative values in the list
I'm not sure if this is a homework problem, as it seems to be a
fairly simple programming problem whether you know Python or not.
If you're using
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:/
hi all,
i am new to python guys.
hope u will help me with this
i have a list of numbers
say a = [1,-1,3,-2,4,-6]
how should i check for negative values in the list
--
http://mail.python.org/mailman/listinfo/python-list
hi all,
--
http://mail.python.org/mailman/listinfo/python-list