puts "Hello" print "World"
puts prints the string and adds a newline. print prints without adding a newline. So the output is Hello with a newline, then World immediately after.
p "Hello" puts "Hello"
p prints the inspected version of the string, which includes quotes. puts prints the string without quotes and adds a newline.
p [1, 2, 3] puts [1, 2, 3]
p prints the array as it is, showing brackets and commas. puts prints each element of the array on a separate line.
puts nil prints a blank line because it converts nil to an empty string. print nil prints nothing. p nil prints the string "nil" because it shows the inspected value.
print outputs text exactly as given, no newline added. puts outputs text and adds a newline after each call. So the first two print calls produce "HelloWorld" with no newline, then puts adds newlines after each string.