0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

多次元配列の勉強

Last updated at Posted at 2023-12-05

配列に関する問題集を解きながら多次元配列の勉強。
一番下の部分は列・行の定義をしっかりしておかないと
混乱しそう。。。

A = [[1,2,3],[4,5,6],[7,8,9]]
#多次元配列の行数の算出
print(len(A))
#多次元配列の列数の算出
print(len(A[0]))
#各行の行数の出力
for i in range(len(A)):
    print(len(A[i]))
#配列i行目j列目の出力
print(A[i-1][j-1])
#各行各列の折返し出力
for j in range(len(A)):
    for i in range(len(A[j])):
        print(A[j][i],end="")
        
        if i < len(A[j])-1:
            print(end=" ")
        else:
            print()

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?