Averages/Arithmetic mean: Difference between revisions
Content deleted Content added
added Cobra example |
|||
Line 375:
mean of [1, 2, 3, 4] is 2.5
</pre>
=={{header|CoffeeScript}}==
<lang coffeescript>
mean = (array) ->
return 0 if array.length is 0
sum = 0
for element in array
sum += element
sum / array.length
alert mean [1]
</lang>
=={{header|Common Lisp}}==
|