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 trialCoding Lab 6
2,170 Points"name error" for name of function that I have been using with no problems in try and except challenges
python basics exceptions challenge #3 Used this function in previous 2 challenges but when I added the "try, except, else" parts I get this name error....."not defined" Don't know what's wrong and can't continue until I fix this. .
def add(x,y):
try:
x = float(x)
y = float(y)
except ValueError:
return none
else:
return x + y
1 Answer
Daniel Gauthier
15,000 PointsHey CL6,
You had everything complete, but you didn't capitalize "None". Once you do, it'll let you pass.
Good luck with the course!