Skip to content

Average of a list · ⁨列表的平均数⁩

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。

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩