00:00
02:22
The difference between puts and print is more subtle. Let's take a look
puts
We're familiar with puts it puts out everything and converts it to string
puts 'something'
puts 'another'
something
another
If we run this ruby script it will simply output the stings in 2 separate lines.
Print is a much more primitive it doesn't add a new line to the end of the output.
print 'something'
print 'else'
somethingelse%
That's the difference between puts and print, hope you found this useful!