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 Try and Except

Can someone explain how I am supposed to word this?

I Know what they are asking of me, but I don't know how to say it. how do I add arguments together?

trial.py
def add(5, 6):
    print(5 + 6)
    return(5 + 6)

1 Answer

Thomas Fildes
Thomas Fildes
16,201 Points

Hi Miguel,

You don't need to put values inside the parenthesis. You only need to place two parameters (e.g. num1 and num2). Then inside the code block of the function you will add num1 and num2 together and return the total. Functions are to be used whenever they are called which is why we use parameter names and not values inside the parenthesis.

Here is the code I used to pass this part of the challenge:

def add(num1, num2):
    total = (num1 + num2)
    return total

Hope this helps! Happy Coding!!!