26
21

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

リストの多次元配列 初期化

Last updated at Posted at 2014-07-10
  • やっちゃダメ
list = [[0]*n]*n
  • こっちでやる
list = [[0 for col in range(n)] for row in range(n)]
26
21
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
26
21

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?