Skip to content

Instantly share code, notes, and snippets.

@jendiamond
Created August 27, 2013 01:17
Show Gist options
  • Save jendiamond/6348632 to your computer and use it in GitHub Desktop.
Save jendiamond/6348632 to your computer and use it in GitHub Desktop.
Exercise 9 - Learn Ruby the Hard Way
# the variable days is assigned in a string
days = "Mon Tues Wed Thu Fri Sat Sun"
# the variable months is assigned with line breaks \n means newline
months = "Jan\nFeb\nMar\nApr\nMay\nJun\Jul\nAug"
# the method puts print the string then on a new line it prints
# the contents of the variable days
puts "Here are the days: ", days
# the method puts print the string then on a new line it prints
# the contents of the variable months
puts "Here are the months: " , months
# the method puts prints the paragraph
puts <<PARAGRAPH
There's something going on here.
With this PARAGRAPH thing
We'll be able to type as much as we like.
Even 4, 5 or even 6 lines if we want
PARAGRAPH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment