Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKevon Hampton
14,136 Pointsim not sure how to complete this
it says i need a space but i included a space already
def ruby(rocks)
puts "ruby" + "rocks"
end
puts "ruby" + "rocks"
5 Answers
Rogier Nitschelm
iOS Development Techdegree Student 5,461 PointsThere 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
Full Stack JavaScript Techdegree Student 22,891 Pointsrewatch the video just before that challenge, at the time => 1:35 - 1:55 it explains the how and why.
Jorge Gomez
Front End Web Development Techdegree Graduate 19,811 PointsThere is no parameter, you are just joining two strings and printing them. You can use puts to print them, you need to add a plus operator with empty quotes to create a space between the strings.
puts "Ruby" + " " + "rocks!"
Ximena Castillo
1,387 PointsYou need to add and extra set of elements=> + " " + between ruby and rocks. It would look something like this:
def ruby(rocks) puts "ruby" + "rocks" end
puts "ruby" + " " + "rocks"
Kevon Hampton
14,136 Pointsthe 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.