Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Ruby Basics (Retired) Ruby Numbers Multiplication and Division

Nathamon Sunthikhunakorn
Nathamon Sunthikhunakorn
2,097 Points

Help! I can't figure out an answer of this question.

Direction: Set the variable product to be a multiple of the variables a and b.

I have tried every possible answer, but it doesn't seem to work. Please help me with this question?

variable.rb
a = 6 
b = 2

3 Answers

Samuel Webb
Samuel Webb
25,370 Points

You're to create a variable called product and you set it to the value returned by a * b. This is to show you that you can multiply variables together and set the value to another variable.

product = a * b

Nathamon Sunthikhunakorn
Nathamon Sunthikhunakorn
2,097 Points

Thank you, Samuel Webb! I didn't think of "product" = a * b before. I was trying a * b | b * a | 6 * 2 | 2 * 6 hahaha ... Once again, thank you very much :)

Samuel Webb
Samuel Webb
25,370 Points

No problem.

Quick question. Are you quoting product in your code too? No need for that. It's not a string, it's a variable and doesn't get quoted.

Nathamon Sunthikhunakorn
Nathamon Sunthikhunakorn
2,097 Points

Nope, I didn't quote it in the exercise. I just wanted to emphasize the word "product" in here. It's a habit of a lit major student :)