Kottiyath wrote:
I have the following list of tuples:
L = [(1, 2), (3, 4, 5), (6, 7)]

I want to loop through the list and extract the values.
The only algorithm I could think of is: [...]

If this is part of a real program, instead of an exercise, you should fix the code that creates this list of tuples so that they have a uniform length of 3. And if the third element is missing, it should be None.

This saves lots of trouble later on.

-- Gerhard
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to