Created
January 26, 2014 18:53
-
-
Save LNA/8637469 to your computer and use it in GitHub Desktop.
Multiplying A Range of Numbers Via Nested Iterations
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
def test | |
test_numbers = [] | |
(5).downto(1).each do |number| | |
(number ..5).each do |range_of_numbers| | |
product = number * range_of_numbers | |
test_numbers << product | |
end | |
end | |
test_numbers | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment