Re: [Tutor] regarding the list problem

2013-02-06 Thread bob gailer
http://www.pythontutor.com/visualize.html is very helpful. Enter your code, click Visualize Execution, then click forward. -- Bob Gailer 919-636-4239 Chapel Hill NC ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription optio

Re: [Tutor] regarding the list problem

2013-02-06 Thread Hugo Arts
On Wed, Feb 6, 2013 at 9:48 AM, Kang, Yang Jae wrote: This line: > >>> a = [[0,0]]*3 > creates a list, a, which contains the list object [0, 0] three times. What's crucial to note is that it contains *the same object* three times, not three different objects with the same value. You can verify

[Tutor] regarding the list problem

2013-02-06 Thread Kang, Yang Jae
Hello I'm a beginner to python. I ran following code and expected [[1, 0], [0, 0], [0, 0]] However unexpected result came up. Anybody who can teach me why and how to solve? Python 3.2.3 (default, May 19 2012, 23:34:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "licens