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 trial

Ruby Ruby Basics Ruby Syntax Variables

How do you make a single call to puts and pass it to 2 arguments?

not understanding how to do this

variables.rb
  language = "ruby"


  description = "awesome"


puts language description
cristacooper
cristacooper
2,571 Points

Just add a comma after language and it should be correct: puts language, description (it may want Ruby with a capital, I can't remember...)

Ediju Rodrigues
Ediju Rodrigues
5,214 Points
language = "Ruby " 
description = "awesome"

puts language,description

You need to put a comma between the two arguments! I know, they don't show it in the videos! Don't know why!

2 Answers

Amrit Pandey
Amrit Pandey
17,595 Points

Yeah, the comments are correct as well, for simplicity you may also pass them surrounding brackets

puts(arg, arg2, arg2...)
cristacooper
cristacooper
2,571 Points

This is good to know about the brackets, thanks!

Thank you all