print statement in Ruby code example Example 1: ruby print puts "hello world" Example 2: ruby how to print puts "string" p "string"