Re: [Tutor] Problems with iterations and breaking loops

2010-03-18 Thread Alan Gauld
"Karjer Jdfjdf" wrote In reality I have to do this for a much larger dataset (eg 1 range * 10 = a lot), so the for v1, v2 in list_of_tuples doesn't work because it is too large for it. What does the size have to do with it? v1,v2 in list_of_tuples will only unpack one tuple at a ti

Re: [Tutor] Problems with iterations and breaking loops

2010-03-17 Thread Karjer Jdfjdf
Thank you all for the input. I've not been clear in my original question. For each value in the range (in example 10) I have to perform calculations with the values in the tuple (in example 3). This makes 30 calculations in total. In reality I have to do this for a much larger dataset (eg 1000

Re: [Tutor] Problems with iterations and breaking loops.

2010-03-17 Thread Alan Gauld
"Karjer Jdfjdf" wrote I have a list of tuples with 2 values. I want to perform calculations on all of these for each value in a range of values (e.g. 100 to 110). So, if I understand you correctly, you want to write a function perform_calculations(value, list_of_tuples, ): for v1,v2 in

Re: [Tutor] Problems with iterations and breaking loops.

2010-03-17 Thread Lie Ryan
On 03/18/2010 02:02 AM, Karjer Jdfjdf wrote: > I'm having problems with iterations and loops.. So I'm curious about the > best Python-way to do iterations of lists (in if, while etc statements) > and breaking of loops. "Best" is a relative term to the current context of the problem. What is best f

Re: [Tutor] Problems with iterations and breaking loops.

2010-03-17 Thread Emile van Sebille
On 3/17/2010 8:02 AM Karjer Jdfjdf said... I'm having problems with iterations and loops. So I'm curious about the best Python-way to do iterations of lists (in if, while etc statements) and breaking of loops. I have a list of tuples with 2 values. I want to perform calculations on all of the

[Tutor] Problems with iterations and breaking loops.

2010-03-17 Thread Karjer Jdfjdf
I'm having problems with iterations and loops. So I'm curious about the best Python-way to do iterations of lists (in if, while etc statements) and breaking of loops. I have a list of tuples with 2 values. I want to perform calculations on all of these for each value in a range of values (e.g.