is this a bug or what?

Roman Suzi rnd at onego.ru
Fri Dec 28 08:05:06 EST 2001


On Thu, 27 Dec 2001, I.J. wrote:

> >>> M=[[0]*3]*3
> >>> M
> [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
> >>> M[1][1]=1
> >>> M
> [[0, 1, 0], [0, 1, 0], [0, 1, 0]]
>
> Is this new age math?

No. Look at the entry 4.50 in Python FAQ

http://www.python.org/cgi-bin/faqw.py?req=show&file=faq04.050.htp

Sincerely yours, Roman A.Suzi
-- 
 - Petrozavodsk - Karelia - Russia - mailto:rnd at onego.ru -






More information about the Python-list mailing list