Average of a list · リストの平均
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · このページには最新のブラウザ(SharedArrayBuffer対応)が必要です。Chrome、Edge、Firefox、Safariを最新バージョンに更新してください。
This one builds on a lesson you haven't finished yet. Do that lesson first: · これはまだ完了していないレッスンの先にある内容です。まずはそのレッスンを済ませてください:
Python Basics · Functions →
English
Average of a list
Return the mean of a list: the total divided by how many numbers there are.
len(nums) tells you how many items the list has. Dividing with / always gives a decimal, so the average of 1 and 2 is 1.5.
日本語
リストの平均値
リストの平均(中央値)を返します: 合計を数字の個数で割った値です。
len(nums) はリストの要素数を返します。/ で割ると常に小数になりますので、1 と 2 の平均は 1.5 です。
Write average(nums) that returns the mean: the total divided by how many numbers there are. The list is never empty. · 合計を数値の個数で割った平均(mean)を返すaverage(nums)を記述する。リストは絶対に空ではない。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。