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 trialJuan Davin
2,792 PointsWhat's wrong?
I cant find what's wrong with my lines of code
def add(x,y):
try:
count=(x+y)
except valueError:
return None
else:
return float(x)+float(y)
1 Answer
Kurt Maurer
16,725 PointsHey Juan,
You're really close! Here are some tips:
- The parentheses around x+y aren't needed.
- The challenge wants you to call the float function on your parameters(x, y) in the try block. So you should see
count = float(x) + float(y)
- The 'V' in
ValueError
needs to be capitalized.
Hope this helps, and let me know how it went!
Juan Davin
2,792 PointsJuan Davin
2,792 PointsThank you!