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 trialJosh Haefner
2,124 PointsWhy isn't this passing?
I just am not sure what I am doing wrong here.
def add(num_1, num_2):
try:
a = float(num_1)
b = float(num_2)
except Value Error:
return None
else:
return a + b
2 Answers
AJ Salmon
5,675 PointsWhen your exception is a Value Error, there's no space between the two words, so it should say return ValueError. Fix that and you're good to go :)
Conrad Cortes
8,418 PointsIt took me a while to figure this out... But ValueError needs to be one word.
Conrad Cortes
8,418 PointsConrad Cortes
8,418 PointsI spent so long trying to figure it out that once I posted and refreshed the page I saw you beat me to it!
AJ Salmon
5,675 PointsAJ Salmon
5,675 PointsHahaha, that happens to me all the time. It took me a while to see it, too.