Ruby: Output

In Ruby, if we have to print something on the output screen we have two options:

  1. print
  2. puts

The difference between the two is that the puts (“put string”) is slightly different from print in such a way that it adds a new line in the output after what you print.

No parenthesis or semicolons are needed.

Published by

Rocking Londoner

www.rockinglondoner.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s