O'Reilly logo

Learn Ruby the Hard Way: A Simple and Idiomatic Introduction to the Imaginative World of Computational Thinking with Code, Third Edition, Video Enhanced Edition by Zed A. Shaw

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required