Created
December 27, 2012 22:42
-
-
Save ahpook/4392777 to your computer and use it in GitHub Desktop.
kitty_lengths.lua
This file contains hidden or 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
cats = {4, 10, 11, 12, 8, 15, 9, 12} | |
i = 1 | |
sum = 0 | |
while i <= #cats do | |
sum = sum + cats[i] | |
i = i + 1 | |
end | |
print("Total kitty length is:", sum, "there are", #cats, "cats, so the average kitty length is", sum / #cats) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment