D
David Spitzer
I am just learning Ruby and I can not seem to see why the first example
works but the second one does not - thanks
Why does this work:
puts 'Hello what is you\'re Favorite Number?'
number = gets.chomp
puts''
puts'-----------------------------------------------------'
puts 'Your favorite number is ' ''+ number + '?'
puts ''
puts 'What a Lovely Number!'
puts ''
puts 'I think '
puts (number.to_i + 1)
puts 'may be a better favorite number though...'
puts '-----------------------------------------------------'
But this does not:
puts 'Hello what is you\'re Favorite Number?'
number = gets.chomp
puts''
puts'-----------------------------------------------------'
puts 'Your favorite number is ' ''+ number + '?'
puts ''
puts 'What a Lovely Number!'
puts ''
puts 'I think ' + (number.to_i + 1) + ' may be a better favorite number
though...'
puts '-----------------------------------------------------'
works but the second one does not - thanks
Why does this work:
puts 'Hello what is you\'re Favorite Number?'
number = gets.chomp
puts''
puts'-----------------------------------------------------'
puts 'Your favorite number is ' ''+ number + '?'
puts ''
puts 'What a Lovely Number!'
puts ''
puts 'I think '
puts (number.to_i + 1)
puts 'may be a better favorite number though...'
puts '-----------------------------------------------------'
But this does not:
puts 'Hello what is you\'re Favorite Number?'
number = gets.chomp
puts''
puts'-----------------------------------------------------'
puts 'Your favorite number is ' ''+ number + '?'
puts ''
puts 'What a Lovely Number!'
puts ''
puts 'I think ' + (number.to_i + 1) + ' may be a better favorite number
though...'
puts '-----------------------------------------------------'