Change value of element in list

O Plameras oscarp at acay.com.au
Sun Jun 18 23:06:58 EDT 2006


Hi,

I'm doing python tutorial,
> http://docs.python.org/tut/node5.html

and I have these,

lists = ['spam', 'eggs', 100, 1234]
lists[2] = lists[2] + 23

I expected this,
lists = ['spam', 'eggs', 123, 1234]

but got this,
lists = ['spam', 'eggs', 100, 1234]

What's my problem here ?

I have Fedora C5 with python2.4.

Thanks.

O Plameras




More information about the Python-list mailing list