change an element of a list

Dirk Hagemann DirkHagemann at gmail.com
Thu Sep 15 05:27:10 EDT 2005


Hi!

I have a list of lists and in some of these lists are elements which I
want to change.
Here an example:
lists=[('abc',  4102,  3572), ('def',  2707, 'None'), ('ghi',  'None',
4102)]

'None' should be replaced by 0 or NULL or something else. But as far as
I know the replace function of the module string does not work for
lists.

Any ideas? Thanks for some help!

Dirk




More information about the Python-list mailing list