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 trialDan Holroyd
1,172 PointsHaving trouble discerning what exactly they want here. It said add a try block. Not sure what to put in it.
I know the final return(float()) section is what they want, but there's nothing specified in the directions as to what they want in the try block, and all it tells me is bummer.
def add(x,y):
try:
return(float(x) + float(y))
except ValueError:
return(None)
else:
return(float(x) + float(y))
add(4,5)
2 Answers
Dan Holroyd
1,172 PointsAnnnndddd....Yup, that was it. Thank you for that!
Garrett Hughes
Python Development Techdegree Student 32,971 PointsHey Dan,
Everything looks correct, your indentation is just off. Make sure all your statements are properly nested in your function and you should be alright.