+ 1

Difference between puts and print in ruby?

not able to understand the difference

12th Mar 2018, 3:44 AM
chinmay ghatpande
chinmay ghatpande - avatar
4 Antworten
+ 3
puts automatically adds a new line after the output, while print does not.
12th Mar 2018, 3:51 AM
Pravin Pandey
Pravin Pandey - avatar
12th Mar 2018, 3:53 AM
Pravin Pandey
Pravin Pandey - avatar
+ 3
puts will provide a new line after the printing. print does not do that.
12th Mar 2018, 5:51 AM
Aaron Stone
Aaron Stone - avatar
+ 1
thank you
12th Mar 2018, 8:44 AM
chinmay ghatpande
chinmay ghatpande - avatar