QP School

Full Version: The difference between print and puts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Print will print whatever you have in one line on the screen, even if there are multiple lines in your code.
For example:


Quote:print 1 + 2
print 2 + 3


This will print the results 3 5 in one line on the screen.

Puts will print whatever you have in a new line on the screen.
For example:


Quote:putsĀ 1 + 2
putsĀ 2 + 3


This will print the results
3
5
in two lines on the screen.