LoginSignup
2
2

Pリスト内包表記を使って2次元配列の要素数を取得するプログラムを実装しました。

array1 = [[1,2,3,4,5,6],[8,1,3,3,1,8]]
print(sum(len(i) for i in array1))
2
2
0

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
2
2