Is there something wrong for put and print?


#1


According to ur course slide:


> The print command just takes whatever you give it and prints it to the screen. puts (for "put string") is slightly different: it adds a new (blank) line after the thing you want it to print.


however, when i test it, they are opposite: puts dont start a new line and print do it


#2

Hello @byteplayer47637,

The instruction says, "In the editor, use at least one print statement and at least one puts statement. "

That means you should do something like:


puts "What's up?"

Do likewise for the "print".

Hope this helps! :slight_smile:


#3

I'm having trouble, also.
I'm typing puts "insert text here" but it's not printing to the screen.
Am I doing something wrong?
sry i am pleb lel


#4

So, for this exercise, you are to use both puts and print. So, after you've done

puts "insert text here"

which "puts" to the screen the string literal, you get an error message that you are yet to complete the print part. And in the instruction, it says to print like: "Hello!". Which you do by,

print "Hello!"

#5

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