Puts and Prints Confusion


Hey all! So I'm a little confused on the difference between puts and prints. I understand that print is used to print a message on the screen, but when I get to puts, I'm find myself in a daze as I don't really understand what the lesson is trying to tell me. Can someone please explain a little bit more?


puts - it prints and also adds a newline character
print - it prints but does not add any character

for ex..

puts "myname"
puts "hisname"

# will print..

but when you use print..

print "myname"
print "hisname"

# it will print this..

also check out this article...


Oh! This makes much more sense. Thank you so much for replying!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.