LoginSignup
20
14

More than 5 years have passed since last update.

pythonでリストを初期化

Posted at

n個の要素を持つ配列が欲しいとき

list = [0 for i in range(n)]

これでn個の要素を0で初期化できた

20
14
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
20
14