Python備忘録

リストの初期化

list_init =  [[] for _ in range(4)]
list_init[1].append('x')
list_init

[[], ['x'], [], []]

この記事を書いた人

目次
閉じる