|
I would like to create a tuple of tuples. As I read (x,y) pairs I would
like to "add" them to others. In the example below, I seem to be
picking up () each time I augment the tuple t. =============== >>> t = () >>> t = t,(0,1) >>> t ((), (0, 1)) >>> t,(2,3) (((), (0, 1)), (2, 3)) ================ Why the repeats of ()? Maybe I need to use another type? Lists? >>> x = x +(1,2) Traceback (most recent call last): File "<pyshell#2>", line 1, in ? x = x +(1,2) TypeError: can only concatenate list (not "tuple") to list >>> x.append((1,2)) >>> x [(1, 2)] That'll probably do me. --
Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
(121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)
"Truth is mighty and will prevail. There is nothing wrong
with this, except that it ain't so." -- Mark Twain
Web Page: <www.speckledwithstars.net/>
|
_______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
