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?
2011/7/4 Asif Jamadar asif.jama...@rezayat.net:
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
Asif Jamadar asif.jama...@rezayat.net 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
Jul 2011 06:24:48
To: bangpypers@python.orgbangpypers@python.org
Reply-To: Bangalore Python Users Group - India bangpypers@python.org
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
On Mon, Jul 4, 2011 at 12:07 PM, delegb...@dudupay.com 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.
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/
: 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, 26, 5),
]
for value
On Mon, Jul 4, 2011 at 12:23 PM, delegb...@dudupay.com 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
On Mon, Jul 4, 2011 at 12:23 PM, delegb...@dudupay.com 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
On Mon, Jul 4, 2011 at 12:01 PM, Noufal Ibrahim nou...@gmail.com wrote:
Asif Jamadar asif.jama...@rezayat.net 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
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
On Mon, Jul 4, 2011 at 1:01 PM, Noufal Ibrahim nou...@gmail.com 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! :)
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 k are used
On Mon, Jul 4, 2011 at 12:53 PM, delegb...@dudupay.com 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
Sender: bangpypers-bounces+delegbede=dudupay@python.org
Date: Mon, 04 Jul 2011 13:05:11
To: Bangalore Python Users Group - Indiabangpypers@python.org
Reply-To: Bangalore Python Users Group - India bangpypers@python.org
Subject: Re: [BangPypers] Iterating list of tuples
delegb...@dudupay.com writes
15 matches
Mail list logo