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 trialPatrick Mockridge
Full Stack JavaScript Techdegree Graduate 45,611 PointsConvert your arguments to floats
float(a) float(b) return (a+b)
def add (a,b):
float(a)
float(b)
return(a+b)
1 Answer
Gianmarco Mazzoran
22,076 PointsHi,
- you need to remove the space between "add" and "(a, b)"
- remove the parenthesis when you return two variables
def add(a, b): # remove space between "add" and "(a, b)"
return float(a) + float(b)
edit answer with correct code
Patrick Mockridge
Full Stack JavaScript Techdegree Graduate 45,611 PointsPatrick Mockridge
Full Stack JavaScript Techdegree Graduate 45,611 PointsActually I wasn't converting a and b into floats, what I needed to do was return (float(a)+float(b)) or assign new variables c=float(a) d=float(b) return(c+d)
Gianmarco Mazzoran
22,076 PointsGianmarco Mazzoran
22,076 Pointsedit with your code
when you return something you don't have to wrap with parenthesis: