Exercise 9. Printing, Printing, Printing

By now you should realize the pattern for this book is to use more than one exercise to teach you something new. I start with code that you might not understand, then more exercises explain the concept. If you don’t understand something now, you will later as you complete more exercises. Write down what you don’t understand, and keep going.

ex9.rb

 1    # Here's some new strange stuff, remember type it exactly.  2  3    days = "Mon Tue Wed Thu Fri Sat Sun"  4    months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug"  5  6    puts "Here are the days: #{days}"  7    puts "Here are the months: #{months}"  8  9    puts """ 10    There's something going on here. 11    With the three ...

Get Learn Ruby the Hard Way: A Simple and Idiomatic Introduction to the Imaginative World of Computational Thinking with Code, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.