Pythonのお勉強 Part23at TECH
Pythonのお勉強 Part23 - 暇つぶし2ch659:デフォルトの名無しさん
08/02/13 15:29:47
>>658
def nestten(temp):
 return [[x] for x in temp]

def flatten(temp):
 return [x[0] for x in temp]

>>> a = flatten(b)
>>> a
[1, 2, 3, 4, 5]
>>>
>>> b = nestten(a)
>>> b
[[1], [2], [3], [4], [5]]

ありが㌧


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch