# Re: Newbie help, please

**URL:** <https://www.ruby-forum.com/t/re-newbie-help-please/166525>\
**Category:** Ruby\
**Created:** [April 26, 2009, 10:03pm UTC](https://www.ruby-forum.com/t/re-newbie-help-please/166525 "2009-04-26T22:03:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7ab992/32.png) [@peterz](https://www.ruby-forum.com/u/peterz)\
**Post date:** [April 26, 2009, 10:03pm UTC](https://www.ruby-forum.com/t/re-newbie-help-please/166525/1 "2009-04-26T22:03:51Z")

</div>

Mike W. wrote:

> Hello all,
> 
> I am a complete novice to programming. I have chosen Ruby as my first  
> language.
> 
> I am attempting to follow some tutorials in a book I have. However, I am  
> running into some errors, and can not figure out why. Can you please  
> guide me?

You cannot simply add strings and numbers together; you must convert  
number to string first.

Try this code:

puts (2+4).to\_s + ’ is the sum of 2+4.’

and

puts ‘Hello, what is your favorite number?’  
number = gets.chomp  
better = number.to\_i+1  
puts number.to\_s + '?? Don\t you know that ’ + better.to\_s + ‘is a  
superior  
selection?’

But the right way to do this is to use expression inlining, such as  
there:

puts “#{2+4} is the sum of 2+4.”

or

puts “#{number}?? Don\t you know that #{better} is a superior  
selection?”

It does .to\_s implicitly. Notice the double quotes, it won’t work with  
single.

```
 WBR, Peter Z.
```
