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

nick beck
nick beck
3,625 Points

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

i don't understand what i meant to do. i have tried everything.

a = 6 b = 2

2 Answers

Hi Nick,

Here's simple solution:

variable_number = value

a, b are variable number while 6, 2 are values

a = 6 
b = 2

Now the question basically ask you to multiply a & b

a = 6 
b = 2
c = a * b  # use multiply *

^^^Output will be 12

Other numbers:

a = 6 
b = 2
c = a + b   # use plus +
c = a - b   # use subtract -
c = a % b   # use percent %

Hope that will work for you.

valerakushnir
valerakushnir
2,265 Points

Hi there, I have the same issue. When I enter c = a * b and check work, it says the answer is incorrect.

I think, the question says "Set the variable product............ ".

If you find variable name, then we can use product instead c which was no longer accepted by the challenge.

Try this:

product = a * b