Lists and Tuples and Much More

Mel Wilson mwilson at the-wire.com
Thu Apr 12 21:23:00 EDT 2007


Scott wrote:
> Now I read somewhere that you could change the list inside that tupple.  But 
> I can't find any documentation that describes HOW to do it.  The only things 
> I CAN find on the subject say, "Don't do it because its more trouble than 
> it's worth."  But that doesn't matter to me, because I want to know 
> everything.

Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> aa = (1, 2, [3, 4])
 >>> aa
(1, 2, [3, 4])
 >>> aa[2].append ((True, False))
 >>> aa
(1, 2, [3, 4, (True, False)])
 >>>

Like that.
	Mel.




More information about the Python-list mailing list