Why wont the computer print out my answers


is there something wrong with my code??


Hi you fogot to put puts your code should be like that

print "What's your first name?"
first_name = gets.chomp
puts "Your name is #{first_name}"

inside the puts you should put the variable first_name inside #{ }


got it!
thanx for the help


another question.
what does the gets.chomp do?


It gets input from the user and chomps off the trailing line break that comes with.


i didnt really understand


That's okay, but it will be easier to answer you if I know what part you don't understand.

You are writing a computer program.
You want to get some in information for your user.
Maybe you want to get their first name and store it in a variable called first_name so you can use it later.
So you write a line of code that gets this data for you, like this:

first_name = gets

You probably noticed, when you ran your program, that you typed your first name then pressed enter/return?
You don't want that enter/return to be part of the data stored in the first_name variable so you chomp it off.

first_name = gets.chomp