Python のリストでは、あとから要素を足すことができます。 前に学んだ append() は「最後に追加」でしたが、途中に入れたいときは insert() を使います。 インデックス1の場所に「ぶどう」が入り、もともとあった「バナナ」や「もも」が後ろにずれて並びます。
この記事が気に入ったら、サポートをしてみませんか? 気軽にクリエイターの支援と、記事のオススメができます!
One of the most useful new features that Microsoft has incorporated into Excel in recent years is the ability to incorporate Python code directly into a spreadsheet. While it has long been possible to ...