adding elements to python tuples
merkosh at hadiko.de
Mon Jan 19 12:22:36 CET 2004
is it possible to append new elements to a tuple? I know tuples are
immutable and that this would mean to create a new tuple with one more
element, but how do you do it?
i.e. i have (1,2,3) and want to append 4:
(1,2,3,4) instead of ((1,2,3),4)
I wanted to use it as a return value of a function and an assignment, but:
(a,b,c),d = myfunc()
doesn't look nice to me. I intended to have
a,b,c,d = myfunc()
Thanks for any suggestions.
More information about the Python-list