puts→ prints output with newline.print→ prints without newline.p→ prints with debugging info (shows object’s raw form).
Example:
puts "Hello" # Hello (new line)
print "Hello" # Hello (no new line)
p "Hello"
puts → prints output with newline.print → prints without newline.p → prints with debugging info (shows object’s raw form).Example:
puts "Hello" # Hello (new line)
print "Hello" # Hello (no new line)
p "Hello"
Leave a Reply