配列の最後に値を追加する Array.push

配列公式データ取得日:2026年11月13日Python:Array.append動作確認待ち

ひとことで言うと

配列に新しい要素を追加します。

ブロックとコード

ブロックの文言は公式の日本語版に合わせています(形は簡易表示です)。

引数(ひきすう)

引数とは、ブロックの中で自分で選んだり入力したりする部分のことです。

名前選べる値意味
itemT

使用例

You might have an array with 3 numbers, like 1, 2, and 3. If you want to add another number to the end, then you push it on to the array. You do it like this:

JavaScript

let thoseNumbers = [1, 2, 3];
thoseNumbers.push(4);

Python

thoseNumbers = [1, 2, 3]
thoseNumbers.append(4)

Add another animal to the end of your list of favorite pets.

JavaScript

let pets = ["cat", "dog", "parrot", "goldfish"];
pets.push("guinea pig");

Python

pets = ["cat", "dog", "parrot", "goldfish"]
pets.append("guinea pig")
執筆:鈴木孝昌官公庁のWeb・システム開発を担当する現役プロジェクトマネージャー。マイクラカップ沖縄代表チームを指導(第6回・第7回、第7回TBS賞)。
沖縄マイクラ部で、子どもたちにMakeCodeを教えています。プロフィールと編集方針
Instagramで教室の様子を見る
noteで記事を読む