Daniel Wagner <brocki2...@googlemail.com> writes:
>> > My short question: I'm searching for a nice way to merge a list of
>> > tuples with another tuple or list. Short example:
>> > a = [(1,2,3), (4,5,6)]
>> > b = (7,8) ...
> the output should look like:
> a = [(1,2,3,7), (4,5,6,8)]

That is not really in the spirit of tuples, which are basically supposed
to be of fixed size (like C structs).  But you could write:

  >>> [x+(y,) for x,y in zip(a,b)]
  [(1, 2, 3, 7), (4, 5, 6, 8)]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to