fl wrote: > Hi, > In the previous exercises, I see list: > cc=[[],[],[]] > > Then, I can have this: > > ccc=[[[]],[[]],[[]]] > > I can also have > > ccc[0] > Out[158]: [[]] > > ccc[0]='o' > > ccc > Out[163]: ['o', [[]], [[]]] > > > I have question: Is there any difference between [[]] and []? > [[]] can have deeper assignment and use than > > ccc[0]='o'
I'm sure with a little effort and a few experiments on the commandline you can answer your question yourself. Please limit your posts to c.l.py to those questions that are a little harder. Hint: when you experiment with nested lists use numbers, not strings as list entries that are not lists themselves. Strings can confuse you about the nesting level: >>> items = ["foo"] >>> items[0] 'foo' >>> items[0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0] 'f' -- https://mail.python.org/mailman/listinfo/python-list