Actually two methods are available:
puts writes with a newline
print writes without a newline
We use print / puts methods to print something..
Difference between print and puts:
example:
a = (1..20).to_a
for i in a
print i
end
o/p: 1 2 3 4 ...20
example:
a = (1..20).to_a
for i in a
puts i
end
1
2
3
4
.
.
20