Last active
October 8, 2018 10:04
-
-
Save kern-me/873b1d42bd73fcfaa6eae6bc41f5a574 to your computer and use it in GitHub Desktop.
Applescript - Find the average of numbers in a list
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
-- Sum of numbers in a list | |
on listAvg(theList) | |
set the_list to theList | |
set a to 0 | |
repeat with this_item in the_list | |
set a to a + this_item | |
end repeat | |
set avg to a / (count the_list) | |
return avg | |
end listAvg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment