how to iterate all sub-element in a list

Mark Lawrence breamoreboy at yahoo.co.uk
Fri Jan 31 09:48:46 EST 2014


On 31/01/2014 10:42, seaspeak at 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 extend method) for lists, and so build
>>
>> lists-of-lists when they could just build them flat in the first
>>
>> place.
>>
>>
>>
>> Skip
> thanks. a keyword is all I need.
> It is not homework. It is a common problem I guess.
>

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 language can do for you, ask 
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list