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

Python Python Basics (2015) Logic in Python Product

Victor Francis
seal-mask
.a{fill-rule:evenodd;}techdegree
Victor Francis
Python Web Development Techdegree Student 497 Points

Need some guide to solve this challenge "I need you to write a function named product. It should take two arguments..."

Not very clear what to do, please help

maxmaltsev
maxmaltsev
3,419 Points
def product(agr1, arg2):
    result = arg1 * arg2
    return result

1 Answer

Victor Francis,

The challenge is wanting you to create a function named Product.

def product():

It also is wanting you to add two arguments. Think of this as two inputs that you are naming.

def product(argument1, argument2):

Then you are requested to multiply these two arguments and return them. You can do this in one line.

return argument1 * argument2

Your full code would look like this:

def product(argument1, argument2):
    return argument1 * argument2

I hope this helps.