Average of a list · Promedio de una lista
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.
Promedio de una lista
Devuelve la media de una lista: el total dividido por la cantidad de números que hay.
len(nums) te indica cuántos elementos tiene la lista. La división con / siempre da como resultado un decimal, por lo que el promedio de 1 y 2 es 1.5.
Write average(nums) that returns · retornos the mean: the total divided by how many numbers there are. The list is never empty. · Escribe average(nums) que devuelva la media: el total dividido por la cantidad de números. La lista nunca está vacía.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.