Created
October 28, 2011 12:53
-
-
Save jomontanari/1322198 to your computer and use it in GitHub Desktop.
Ruby - Day 1 (7l7w)
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
#Print the string Hello World | |
puts "Hello, World" | |
#Find the index of Ruby in "Hello, Ruby" | |
"Hello, Ruby".index("Ruby") | |
#Print your name 10 times | |
(1..10).each do | |
puts "Jo Cranford" | |
end | |
#Print "this is sentence number 1" where the number 1 changes from 1 to 10 | |
(1..10).each do |num| | |
puts "this is sentence number #{num}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment