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

Gabriel Ogbonnaya
Gabriel Ogbonnaya
1,701 Points

float

What is wrong

trial.py
def add(float(gain),float(mike)):
    return(gain + mike)
Angatvir Sanghera
Angatvir Sanghera
Courses Plus Student 4,406 Points

I don't really understand what you are trying to do. If you're passing two floats into a function then you do not need to label them floats. Just make sure they are floats when you pass them in.

def add (gain, mike):
    return (gain + mike)

gain = 3.1
mike = 2.1

result = (gain, mike)
print (result)

1 Answer

Steven Parker
Steven Parker
231,269 Points

You can't call functions inside your parameter declarations.

But this seems to be a duplicate question, and there's already an example solution posted to the original question.