Exercise 9. Printing, Printing, Printing

Image

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 ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.