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

Antonie Huang
Antonie Huang
985 Points

How do I set 2 augment and return it?

How do I set 2 augment and return it?

product.py
def product(hahaha, hehehe):

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 67,477 Points

When the challenge asks to create a function, you don't have to create the variables to call it. The challenge checker will take car of that.

So you are on the right path:

# Write function named product. 
# It should take two arguments,
#  you can call them whatever you want....
def product(hahaha, hehehe):
    #  and then multiply them together
    result = hahaha * hehehe
    # and return the result.
    return result

Edit: Oops! Multiplication (*) not Addition (+).

Haider Ali
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Haider Ali
Python Development Techdegree Graduate 24,724 Points

Hi there. Your function needs to take in 2 arguments and multiply them together using the multiplication operator which is an asterisc:

def product(a, b):
  return a*b