Re: Is there an meaning of '[[]]' in a list?
Op 23-11-15 om 09:57 schreef Peter Otten: > Quivis wrote: > >> On Thu, 19 Nov 2015 12:40:17 +0100, Peter Otten wrote: >> >>> those questions that are a little harder >> And just how is he going to determine what is hard? > Note that I said "a little harder", not "hard". > > Write down your next ten or so questions, then work through the tutorial or > another introductory text, then use a search engine, then post the one or > two questions that are still unanswered. The problem is of course that he may already be doing that. We have just no idea about which questions he solved for himself because those are not mentioned here. But I do agree that he probably should try harder, he doesn't seem to come with the result of an experiment he tried where the result surprised him. -- Antoon. -- https://mail.python.org/mailman/listinfo/python-list
Re: Is there an meaning of '[[]]' in a list?
Quivis wrote: > On Thu, 19 Nov 2015 12:40:17 +0100, Peter Otten wrote: > >> those questions that are a little harder > > And just how is he going to determine what is hard? Note that I said "a little harder", not "hard". Write down your next ten or so questions, then work through the tutorial or another introductory text, then use a search engine, then post the one or two questions that are still unanswered. -- https://mail.python.org/mailman/listinfo/python-list
Re: Is there an meaning of '[[]]' in a list?
On Sun, Nov 22, 2015 at 6:25 PM, Quiviswrote: > On Thu, 19 Nov 2015 12:40:17 +0100, Peter Otten wrote: > > > those questions that are a little harder > > And just how is he going to determine what is hard? > -- > _ __ __ __ __ __ __ __ > (( )) || || || \\ // || (( > \\_/X| \\_// || \V/ || \_)) >Omnia paratus *~*~*~*~*~*~* > -- > https://mail.python.org/mailman/listinfo/python-list > from the OP: Hi, In the previous exercises, I see list: cc=[[],[],[]] This seems to refer to some tutorial maybe? I suppose there could be some value in an exercise like this, but I don't see it. -- Joel Goldstick http://joelgoldstick.com/stats/birthdays -- https://mail.python.org/mailman/listinfo/python-list
Is there an meaning of '[[]]' in a list?
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' Thanks, -- https://mail.python.org/mailman/listinfo/python-list
Re: Is there an meaning of '[[]]' in a list?
> I have question: Is there any difference between [[]] and []? Yes. [] - a list with zero elements. That is an empty list. [[]] - A list with one element. (That element is an empty list.) > [[]] can have deeper assignment and use than You can have it as deep as you want, if you have enough memory. -- https://mail.python.org/mailman/listinfo/python-list
Re: Is there an meaning of '[[]]' in a list?
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
Re: Is there an meaning of '[[]]' in a list?
On 19/11/2015 11:28, 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' Thanks, I have question. Is there any chance that you stop wasting the time of people on this list by either doing your own research or trying things at an interactive prompt? Or are you now well past that point, as you're learned that the extremely generous people here have fitted your bibs, spoon fed you and and changed your nappies so many times that it has rendered you incapable of doing anything for yourself? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list