Re: [BangPypers] if not with comparision statement in python

2011-08-02 Thread Dhananjay Nene
On Tue, Aug 2, 2011 at 11:12 AM, Anand Balachandran Pillai wrote: > On Mon, Aug 1, 2011 at 7:51 PM, Dhananjay Nene > wrote: > >> On Mon, Aug 1, 2011 at 7:26 PM, Anand Balachandran Pillai >> wrote: >> >  IMHO, map/filter/reduce and the inevitable companion lambda were >> >  added on to Python whe

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Noufal Ibrahim
Anand Balachandran Pillai writes: [...] > 1. List comp > > >>> sum([x*x for x in range(10)]) > 285 > > 2. Map > > >>> sum(map(lambda x: x*x, range(10))) > 285 > > 3. Reduce > > >>> reduce(lambda x,y: x + y*y, range(10)) > 285 A quote from Guido "filter(P, S) is almost always written c

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Anand Balachandran Pillai
On Mon, Aug 1, 2011 at 7:51 PM, Dhananjay Nene wrote: > On Mon, Aug 1, 2011 at 7:26 PM, Anand Balachandran Pillai > wrote: > > IMHO, map/filter/reduce and the inevitable companion lambda were > > added on to Python when it was still trying to find its identity on > where > > it stood in the pa

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Dhananjay Nene
On Mon, Aug 1, 2011 at 7:26 PM, Anand Balachandran Pillai wrote: >  IMHO, map/filter/reduce and the inevitable companion lambda were >  added on to Python when it was still trying to find its identity on where >  it stood in the pantheon of dynamic typed languages - since it wanted >  to be everyt

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Dhananjay Nene
On Mon, Aug 1, 2011 at 5:44 PM, Dhananjay Nene wrote: > On Mon, Aug 1, 2011 at 5:07 PM, Anand Chitipothu wrote: >> 2011/8/1 Dhananjay Nene : >>> On Mon, Aug 1, 2011 at 4:17 PM, Anand Chitipothu >>> wrote: 2011/8/1 Dhananjay Nene : > On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar >

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Anand Balachandran Pillai
On Mon, Aug 1, 2011 at 5:07 PM, Anand Chitipothu wrote: > 2011/8/1 Dhananjay Nene : > > On Mon, Aug 1, 2011 at 4:17 PM, Anand Chitipothu > wrote: > >> 2011/8/1 Dhananjay Nene : > >>> On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar < > asif.jama...@rezayat.net> wrote: > What if I have two lists

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Dhananjay Nene
On Mon, Aug 1, 2011 at 4:41 PM, Baishampayan Ghose wrote: > On Mon, Aug 1, 2011 at 4:38 PM, Dhananjay Nene > wrote: >> I also find map much more atomic and portable construct to think in - >> after all every list comprehension is syntactic sugar around map + >> filter, and map/reduce/filter are

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Dhananjay Nene
On Mon, Aug 1, 2011 at 5:07 PM, Anand Chitipothu wrote: > 2011/8/1 Dhananjay Nene : >> On Mon, Aug 1, 2011 at 4:17 PM, Anand Chitipothu >> wrote: >>> 2011/8/1 Dhananjay Nene : On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar wrote: > What if I have two lists for both minimum and max

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Baishampayan Ghose
On Mon, Aug 1, 2011 at 5:09 PM, Anand Chitipothu wrote: >>> I also find map much more atomic and portable construct to think in - >>> after all every list comprehension is syntactic sugar around map + >>> filter, and map/reduce/filter are far more omnipresent than list >>> comprehensions. >> >> Th

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Anand Chitipothu
2011/8/1 Baishampayan Ghose : > On Mon, Aug 1, 2011 at 4:38 PM, Dhananjay Nene > wrote: >> I also find map much more atomic and portable construct to think in - >> after all every list comprehension is syntactic sugar around map + >> filter, and map/reduce/filter are far more omnipresent than lis

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Anand Chitipothu
2011/8/1 Dhananjay Nene : > On Mon, Aug 1, 2011 at 4:17 PM, Anand Chitipothu wrote: >> 2011/8/1 Dhananjay Nene : >>> On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar >>> wrote: What if I have two lists for both minimum and maximum values Minimum  Maximum 0               10

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Baishampayan Ghose
On Mon, Aug 1, 2011 at 4:38 PM, Dhananjay Nene wrote: > I also find map much more atomic and portable construct to think in - > after all every list comprehension is syntactic sugar around map + > filter, and map/reduce/filter are far more omnipresent than list > comprehensions. The above will es

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Dhananjay Nene
On Mon, Aug 1, 2011 at 4:17 PM, Anand Chitipothu wrote: > 2011/8/1 Dhananjay Nene : >> On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar >> wrote: >>> What if I have two lists for both minimum and maximum values >>> >>> Minimum  Maximum >>> 0               10 >>> 11              20 >>> 21          

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Anand Chitipothu
2011/8/1 Dhananjay Nene : > On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar > wrote: >> What if I have two lists for both minimum and maximum values >> >> Minimum  Maximum >> 0               10 >> 11              20 >> 21              30 >> 31              40 >> >> >> Now how should I check if actu

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Rajeev J Sebastian
On Mon, Aug 1, 2011 at 12:08 PM, Anand Balachandran Pillai wrote: > On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar wrote: > >> What if I have two lists for both minimum and maximum values >> >> Minimum  Maximum >> 0               10 >> 11              20 >> 21              30 >> 31              40

Re: [BangPypers] if not with comparision statement in python

2011-08-01 Thread Dhananjay Nene
On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar wrote: > What if I have two lists for both minimum and maximum values > > Minimum  Maximum > 0               10 > 11              20 > 21              30 > 31              40 > > > Now how should I check if actual result is not laying between above ran

Re: [BangPypers] if not with comparision statement in python

2011-07-31 Thread Anand Balachandran Pillai
On Sat, Jul 30, 2011 at 2:15 PM, Asif Jamadar wrote: > What if I have two lists for both minimum and maximum values > > Minimum Maximum > 0 10 > 11 20 > 21 30 > 31 40 > > > Now how should I check if actual result is not laying between above ran

Re: [BangPypers] if not with comparision statement in python

2011-07-30 Thread Noufal Ibrahim
Asif Jamadar writes: > What if I have two lists for both minimum and maximum values > > Minimum Maximum > 0 10 > 1120 > 2130 > 3140 > > > Now how should I check if actual result is not laying between above ranges > > if not minimum<=act

[BangPypers] if not with comparision statement in python

2011-07-30 Thread Asif Jamadar
What if I have two lists for both minimum and maximum values Minimum Maximum 0 10 11 20 21 30 31 40 Now how should I check if actual result is not laying between above ranges if not minimum<=actual_result and not maximum>=actual

Re: [BangPypers] if not with comparision statement in python

2011-07-30 Thread Navin Kabra
On Sat, Jul 30, 2011 at 1:13 PM, Asif Jamadar wrote: > if not minimum<=actual_result and  not maximum>=actual_result: > > How to check if actual result is not laying between minimum value and maximum > value. if not minimum <= actual_result <= maximum: ___

Re: [BangPypers] if not with comparision statement in python

2011-07-30 Thread Noufal Ibrahim
Asif Jamadar writes: > if not minimum<=actual_result and not maximum>=actual_result: > > > How to check if actual result is not laying between minimum value and maximum > value. > > how should I represent the above statement in python? > > Any suggestions? [...] The following will check for r

[BangPypers] if not with comparision statement in python

2011-07-30 Thread Asif Jamadar
if not minimum<=actual_result and not maximum>=actual_result: How to check if actual result is not laying between minimum value and maximum value. how should I represent the above statement in python? Any suggestions? ___ BangPypers mailing list Ban