Skip to content · ⁨コンテンツへスキップ⁩

Sum a list · ⁨リストの合計⁩

English

Sum a list

Add up every number in a list and return the total. Start a running total at 0, then loop over the list and add each value to it.

This pattern — a running total that grows inside a loop — comes up everywhere in programming.

日本語

リストの合計

リスト内のすべての数を足し合わせ、総和を返します。合計値を 0 から始め、リストをループして各値を加えていきます。

このパターン — ループ内で累加する合計値 — はプログラミング全体で頻繁に登場します。

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP