Re: checking for negative values in a list

2007-12-17 Thread vimal
thanks for your help Tim and Marc. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: checking for negative values in a list

2007-12-17 Thread Tim Chase
> 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

Re: checking for negative values in a list

2007-12-17 Thread Marc 'BlackJack' Rintsch
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:/

checking for negative values in a list

2007-12-17 Thread vimal
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

checking for negative values in a list

2007-12-17 Thread vimal
hi all, -- http://mail.python.org/mailman/listinfo/python-list