Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Chris H
Python Web Development Techdegree Student 1,368 Pointstrial task 3
help please? trial task 3
def add(number1, number2):
try:
number1 = float(number1)
number2 = float(number2)
except ValueError:
returne None
return(number1 + number2)
1 Answer

taejooncho
Courses Plus Student 3,923 PointsHi, there
Looking at your code you are very close!
Just some issues and mistake. First, this part from your code needs adjustment.
try:
number1 = float(number1)
number2 = float(number2)
When you write try your code that is inside the try needs to be indented. Right now your two codes are not indented.
Second, the task want you to write else: so if you write else: before you write return (number1+number2) you will be spot on!
Hope this helps!
Chris H
Python Web Development Techdegree Student 1,368 PointsChris H
Python Web Development Techdegree Student 1,368 PointsThanks, still not getting though?
taejooncho
Courses Plus Student 3,923 Pointstaejooncho
Courses Plus Student 3,923 PointsI copied your code and tried to do the challenge to see what else is wrong and I found a typo in your code. You wrote returne when it should have been return. Other than that, when I fixed your code like I mentioned it should let you pass the task.
Chris H
Python Web Development Techdegree Student 1,368 PointsChris H
Python Web Development Techdegree Student 1,368 Pointsthanks for all your help my code is still not passing can you please show me what its should look like?
taejooncho
Courses Plus Student 3,923 Pointstaejooncho
Courses Plus Student 3,923 PointsOkay, Let me use your code and with comment it might be more helpful.