"Karjer Jdfjdf" <karper12...@yahoo.com> 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 list_of_tuples:
# something = calculate( value, v1, v2)
return something
Then you iterate over your values:
results = [perform_calculations(value, list_of_tuples) for value in
range(min,max+!)]
results should then be a list of results (which might in turn be tuples or
lists)
Does that work for you?
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor