Re: [BangPypers] Iterating list of tuples

2011-07-04 Thread delegbede
l Message- From: Noufal Ibrahim Sender: bangpypers-bounces+delegbede=dudupay@python.org Date: Mon, 04 Jul 2011 13:05:11 To: Bangalore Python Users Group - India Reply-To: Bangalore Python Users Group - India Subject: Re: [BangPypers] Iterating list of tuples delegb...@dudupay.com writes

Re: [BangPypers] Iterating list of tuples

2011-07-04 Thread Venkatraman S
On Mon, Jul 4, 2011 at 12:53 PM, wrote: > You sound quite rude and arrogant. > > This is a public forum and you should manage your choice of words. > > My error was a typo and I wouldn't have pushed what I haven't tried out. > > What I didn't put was the index of the tuple in the list and that sh

Re: [BangPypers] Iterating list of tuples

2011-07-04 Thread Anand Chitipothu
>        for i in data[0]: # Iterate over elements of the tuple >             if i > 5: >                print "greater" >             else: >                print "lesser" > > `value` in your code does not mean the index, it's the actual element > itself. It is unsaid rule that variables i, j and

Re: [BangPypers] Iterating list of tuples

2011-07-04 Thread Venkatraman S
On Mon, Jul 4, 2011 at 1:01 PM, Noufal Ibrahim wrote: > > Right. I wrote this and then didnt send as the OP sounds like a n00b. > > > n00b (especially with the leet speak) is a tad pejorative. I think you > should not use the word here. > I apologize captain! :) _

Re: [BangPypers] Iterating list of tuples

2011-07-04 Thread Noufal Ibrahim
delegb...@dudupay.com writes: > Venkatraman, > > You sound quite rude and arrogant. Maybe but these *are* public lists and you'll find all sorts of people here. Venkat's mail was to the point but lacked sugar coating and (in poor taste) contained an accusation. I think you should just let it

Re: [BangPypers] Iterating list of tuples

2011-07-04 Thread Noufal Ibrahim
Venkatraman S writes: [...] > Right. I wrote this and then didnt send as the OP sounds like a n00b. n00b (especially with the leet speak) is a tad pejorative. I think you should not use the word here. > Btw, i got a Q: why doesnt 'any' work in this case? Like... > for tup in data: > if an

Re: [BangPypers] Iterating list of tuples

2011-07-04 Thread delegbede
l for my head. You should however manage how you address people in a forum like this. Sent from my BlackBerry wireless device from MTN -Original Message- From: Venkatraman S Date: Mon, 4 Jul 2011 12:38:53 To: ; Bangalore Python Users Group - India Subject: Re: [BangPypers] Iterating li

Re: [BangPypers] Iterating list of tuples

2011-07-04 Thread Venkatraman S
On Mon, Jul 4, 2011 at 12:47 PM, Anand Balachandran Pillai < abpil...@gmail.com> wrote: > >>> data=[(10,25, 18, 17, 10, 12, 26, 5)] > > >>> for value in zip(*data): > ... if (value[0] > 5): print 'Greater' > ... else: print 'Lesser' > Right. I wrote this and then didnt send as the OP

Re: [BangPypers] Iterating list of tuples

2011-07-04 Thread Anand Balachandran Pillai
On Mon, Jul 4, 2011 at 12:01 PM, Noufal Ibrahim wrote: > Asif Jamadar writes: > > > Suppose I have list of tuples > > > > data = [ > > (10, 25, 18, 17, 10, 12, 26, 5), > > ] > > > > for value in data: > > if data[value]>5: > > print " greater" > > else: > >

Re: [BangPypers] Iterating list of tuples

2011-07-04 Thread Venkatraman S
On Mon, Jul 4, 2011 at 12:23 PM, wrote: > I still can't see my mistake Kenneth. > > May I just point out that, I am quite unhappy with Venk's choice of word. > I would have apologized if you had tried the code that you had written or atleast mentioned in the email that 'i havent tried, but somet

Re: [BangPypers] Iterating list of tuples

2011-07-04 Thread selva4...@gmail.com
On Mon, Jul 4, 2011 at 12:23 PM, wrote: > I still can't see my mistake Kenneth. > > May I just point out that, I am quite unhappy with Venk's choice of word. > > Should there be a mistake in what I wrote, there surely wouldn't be an > intention to misguide. > > Kindly point out the mistake pleas

Re: [BangPypers] Iterating list of tuples

2011-07-03 Thread delegbede
sage-- From: Kenneth Gonsalves To: delegb...@dudupay.com To: Bangalore Python Users Group - India Subject: Re: [BangPypers] Iterating list of tuples Sent: 4 Jul 2011 7:46 AM On Mon, 2011-07-04 at 06:37 +, delegb...@dudupay.com wrote: > > data = [ > (10, 25, 18, 17, 10, 12,

Re: [BangPypers] Iterating list of tuples

2011-07-03 Thread Kenneth Gonsalves
On Mon, 2011-07-04 at 06:37 +, delegb...@dudupay.com wrote: > > data = [ > (10, 25, 18, 17, 10, 12, 26, 5), > ] > > for value in data: > if value > 5: value = (10, 25, 18, 17, 10, 12, 26, 5) -- regards Kenneth Gonsalves http://lawgon.livejournal.com/ _

Re: [BangPypers] Iterating list of tuples

2011-07-03 Thread Venkatraman S
On Mon, Jul 4, 2011 at 12:07 PM, wrote: > > Your new code should read this. > > data = [ >(10, 25, 18, 17, 10, 12, 26, 5), >] > > for value in data: > if value > 5: > print " greater" >else: >print "lesser" > WRONG. Please dont misguide. _

Re: [BangPypers] Iterating list of tuples

2011-07-03 Thread delegbede
te: Mon, 4 Jul 2011 06:24:48 To: bangpypers@python.org Reply-To: Bangalore Python Users Group - India Subject: [BangPypers] Iterating list of tuples Suppose I have list of tuples data = [ (10, 25, 18, 17, 10, 12, 26, 5), ] for value in data: if data[value]>5: prin

Re: [BangPypers] Iterating list of tuples

2011-07-03 Thread Venkatraman S
On Mon, Jul 4, 2011 at 11:54 AM, Asif Jamadar wrote: > Suppose I have list of tuples > > data = [ >(10, 25, 18, 17, 10, 12, 26, 5), >] > > for value in data: > if data[value]>5: >print " greater" >else: > print "lesser" > > But the code giving me error so can

Re: [BangPypers] Iterating list of tuples

2011-07-03 Thread Noufal Ibrahim
Asif Jamadar writes: > Suppose I have list of tuples > > data = [ > (10, 25, 18, 17, 10, 12, 26, 5), > ] > > for value in data: > if data[value]>5: > print " greater" > else: >print "lesser" if the list has just one tuple, you need to iterate over it's i

Re: [BangPypers] Iterating list of tuples

2011-07-03 Thread Anand Chitipothu
2011/7/4 Asif Jamadar : > Suppose I have list of tuples > > data = [ >    (10, 25, 18, 17, 10, 12, 26, 5), >    ] > > for value in data: >     if data[value]>5: >                print " greater" >    else: >       print "lesser" > > But the code giving me error so can I know how iterate list of tup

[BangPypers] Iterating list of tuples

2011-07-03 Thread Asif Jamadar
Suppose I have list of tuples data = [ (10, 25, 18, 17, 10, 12, 26, 5), ] for value in data: if data[value]>5: print " greater" else: print "lesser" But the code giving me error so can I know how iterate list of tuples? ___