Created
November 14, 2020 06:10
-
-
Save atirut-w/420008f6391e8aade3f85a0422564ae3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function math.average(t) | |
local sum = 0 | |
for _,v in pairs(t) do -- Get the sum of all numbers in t | |
sum = sum + v | |
end | |
return sum / #t | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment