Re: how to iterate all sub-element in a list

2014-01-31 Thread seaspeak
Mark Lawrence於 2014年1月31日星期五UTC+8下午10時48分46秒寫道: > I'm pleased to see that you have answers. In return would you please read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing the double line spacing above, thanks. > My fellow Pythonistas, ask not what our lang

Re: how to iterate all sub-element in a list

2014-01-31 Thread Mark Lawrence
On 31/01/2014 10:42, seasp...@gmail.com wrote: Skip Montanaro於 2014年1月31日星期五UTC+8下午6時29分27秒寫道: Google for "python flatten list." This question comes up frequently, though I'm not sure if that's because it's a common homework problem or because people are unaware of the += operator (or exten

Re: how to iterate all sub-element in a list

2014-01-31 Thread Rustom Mody
On Friday, January 31, 2014 4:18:13 PM UTC+5:30, Peter Otten wrote: > seaspeak wrote: > > a list like L = [[1, 2], [3, 4, 5], [6]], which has > > random numbers of list, which has random numbers. > > How do I get another list m = [1, 2, 3, 4, 5, 6] in a succinct way? ( or > > iterate them) I shoul

Re: how to iterate all sub-element in a list

2014-01-31 Thread Peter Otten
seasp...@gmail.com wrote: > a list like L = [[1, 2], [3, 4, 5], [6]], which has > random numbers of list, which has random numbers. > > How do I get another list m = [1, 2, 3, 4, 5, 6] in a succinct way? ( or > iterate them) I should provide my own solution, but I really can't come > out with one

Re: how to iterate all sub-element in a list

2014-01-31 Thread seaspeak
Skip Montanaro於 2014年1月31日星期五UTC+8下午6時29分27秒寫道: > Google for "python flatten list." > > > > This question comes up frequently, though I'm not sure if that's > > because it's a common homework problem or because people are unaware > > of the += operator (or extend method) for lists, and so buil

Re: how to iterate all sub-element in a list

2014-01-31 Thread Skip Montanaro
Google for "python flatten list." This question comes up frequently, though I'm not sure if that's because it's a common homework problem or because people are unaware of the += operator (or extend method) for lists, and so build lists-of-lists when they could just build them flat in the first pla

how to iterate all sub-element in a list

2014-01-31 Thread seaspeak
a list like L = [[1, 2], [3, 4, 5], [6]], which has random numbers of list, which has random numbers. How do I get another list m = [1, 2, 3, 4, 5, 6] in a succinct way? ( or iterate them) I should provide my own solution, but I really can't come out with one. -- https://mail.python.org/mailman/