Ruby Ruby Basics Strings String Concatenation

im not sure how to complete this

it says i need a space but i included a space already

program.rb
def ruby(rocks)
puts "ruby" + "rocks"
end


puts "ruby" + "rocks"

3 Answers

Rogier Nitschelm
Rogier Nitschelm
iOS Development Techdegree Student 5,460 Points

There is no space in the code you have shown. But you could easily add a space:

puts "ruby rocks"
puts "ruby" + " rocks" 
puts  "ruby rocks"

However - the function signature has a parameter (rocks). Which suggest you have to do something with that. I cannot tell by your question what problem you're supposed to solve, however - I can imagine it could be something like:

def ruby(rocks)
   puts "ruby #{rocks}"
end
yk7
yk7
21,002 Points

rewatch the video just before that challenge, at the time => 1:35 - 1:55 it explains the how and why.

the question was, Using string concatenation, join the strings "Ruby" and "rocks!" together. Be sure to include a space between "Ruby" and "rocks!". Then print the result using puts. i still cannot figure out how to complete it.