Tuples

Lawrence Oluyede raims at dot.com
Thu Dec 15 12:25:19 EST 2005


Il 2005-12-15, Tuvas <tuvas21 at gmail.com> ha scritto:

First, these are lists not tuples

> Let's say I make a program something like follows:
>
> x=[]
> x.append([1,2,3])
> x.append([4,5,6])
> print x
> print x[0]
> print x[0][1]
> x[0][1]=5
>
> Okay, everything works here as expected except the last line. Why won't
> this work? Thanks for the help!
>

Why not? for me works. After the last sentence if you print out x you get:

[[1, 5, 3], [4, 5, 6]]


-- 
Lawrence - http://www.oluyede.org/blog
"Anyone can freely use whatever he wants but the light at the end
of the tunnel for most of his problems is Python"



More information about the Python-list mailing list