Hello all A question from very beginner. I generate a simple example array and then print its elements on the screen.
f=[[0]*3]*3 # array initialization for i in range(3): for j in range(3): f[i][j]=str(i)+str(j) # make simple example array print f[i][j], # print resulting elements print '\n' 00 01 02 10 11 12 20 21 22 So I generate element in loop and then print it and see all is ok. But after that if I print the whole generated array, I see different result with constant first number, as if "i" variable does not vary and equals to "2". What is wrong? >>> print f [['20', '21', '22'], ['20', '21', '22'], ['20', '21', '22']] I use python 2.7 _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor