Created
January 27, 2020 17:17
-
-
Save zaagan/647de1bc9cde32f00e0773dde6251f00 to your computer and use it in GitHub Desktop.
Ruby Basics - Upto & Downto
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
1.upto 5 do |i| | |
puts i | |
end | |
# 1 | |
# ... | |
# 5 | |
5.downto 1 do |i| | |
puts i | |
end | |
# 5 | |
# ... | |
# 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment