creates a 4x4 2D array named my_2d_array containing strings, initialises an empty string variable named diagonal1 to store the concatenated elements along the main diagonal of the 2D array, the outer for row in range(len(my_2d_array)) loop iterates through the rows of the 2D array, the inner for col in range(len(my_2d_array[row])) loop iterates through the columns within each row, checks if the current row index is equal to the current col index. In which case, we have a diagonal, appends (concatenates) the string value at my_2d_array[row, col] to the diagonal1 string, prints the concatenated elements along the main diagonal by displaying the content of the diagonal1 variable.
0%
SDD Implementation - 2D arrays (Describing Code 3)
共有
共有
共有
Gw09brucejennif
さんの投稿です
コンテンツの編集
印刷
埋め込み
もっと見る
割り当て
リーダーボード
もっと表示する
表示を少なくする
このリーダーボードは現在非公開です。公開するには
共有
をクリックしてください。
このリーダーボードは、リソースの所有者によって無効にされています。
このリーダーボードは、あなたのオプションがリソースオーナーと異なるため、無効になっています。
オプションを元に戻す
ラベル付きの図
は自由形式のテンプレートです。リーダーボード用のスコアは生成されません。
ログインが必要です
表示スタイル
フォント
サブスクリプションが必要です
オプション
テンプレートを切り替える
すべてを表示
アクティビティを再生すると、より多くのフォーマットが表示されます。
オープン結果
リンクをコピー
QRコード
削除
自動保存:
を復元しますか?