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

Hunter Nelson
Hunter Nelson
533 Points

Help with Task 2 please... I don't understand what the computer wants.

It says to float the arguments... didn't I do that?

trial.py
def add(x, y):
    return(X+y)
float(x, y)

1 Answer

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 Points

You need to turn them into floats individually inside the function that you're defining. Also, make sure you use lowercase x to refer to the same parameter. The return keyword doesn't take parentheses, you don't "call" it like you do with a function.

def add(x, y):
    return float(x) + float(y)