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.

Python Python Basics (2015) Logic in Python Product

Victor Francis
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

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.