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

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 68,457 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 (+).

Multiplication operator :)

Chris Freeman
Chris Freeman
Treehouse Moderator 68,457 Points

Yikes! That's what I get when trying to answer forum questions on my iPhone. Answer updated. Thanks.

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