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 (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 :)