How to make arrays from Lists

gc_ottawa at yahoo.ca gc_ottawa at yahoo.ca
Tue Nov 11 19:32:47 EST 2008


I want to construct a 2-dimensional array from a List but I cannot
find a simple way of changing any element. For example, construct a
3x3 array like this:-
>>> x=[0,0,0]
       x=[x]*3
this produces [[0,0,0],[0,0,0],[0,0,0]. So far so good.
How do I change the value of any element to produce (say)
[[99,0,0],[0,0,0],[0,0,0]] ?

gordc



More information about the Python-list mailing list