Learn to Program, Answers

Answer key to the exercises in Chris Pine's Learn to Program book.

Get the book



  • Answer Key
  • p. 12: 2.4 A Few Things to Try
  • p. 26: 5.4 A Few Things to Try
  • p. 32: Last Paragraph
  • p. 35: 6.2 A Few Things to Try
  • p. 49: Sidebar
  • p. 55: 7.5 A Few Things to Try
  • p. 62: Last Paragraph
  • p. 63: 8.3 A Few Things to Try
  • p. 72: Top of Page
  • p. 76: 9.4 A Few Things to Try
  • p. 83: Bottom of the Page
  • p. 84: 10.2 Sorting
  • p. 85: 10.3 A Few Things ...
  • p. 92: 10.5 A Few More ...
  • p. 104: 11.6 A Few Things ...
  • p. 108: 12.2 A Few Things ...
  • p. 113: 12.6 A Few Things ...
  • p. 117: 13.1 A Few Things ...
  • p. 126: 13.4 A Few More ...
  • p. 136 14.4: A Few Things ...

PAGE 49 Sidebar

Change example 'bye' program to get rid of first space

input = ''
while input != 'bye'
input = gets.chomp
if input != 'bye'
puts input
end
end
puts 'Come again soon!'

Newer Post Older Post Home