Ruby: Print

By Xah Lee. Date: .

To print, use p, puts, print.

# ruby
a = 5
b = "rabbit"
p a, b, 3 # prints each on a new line.

this is a multi-line comment

p a, b, 3

can be written as

p(a, b, 3)

parenthesis are often not necessary

What is the difference between {puts, print, p}?