Puts and Print


puts "Hello"
print "Hi"

i am getting the output as



Can i know the reason why nil is being printed in the later part of print ?


Because the console in the course is printing out what the last instruction evaluates to (print returns nil). In my opinion it shouldn’t because it seems to confuse many people.

If you want a better distinction between the last return and the output, you can try your code here, it prints the output normally and the return is shown in green.

labs repl.it


Thanks for the response :smile: