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 trialKyle & Lainy Clemens-Arbues
2,640 PointsKeeps saying task one is no longer passing. What am i doing wrong?
I just can’t figure it out and I don’t quite understand Try and except
def add(a,b):
try:
count = int(input())
except ValueError:
return(None)
else:
return(float(a)+float(b))
1 Answer
Chris Freeman
Treehouse Moderator 68,454 PointsThe message "Task 1 is no longer passing" is usually caused by an syntax error. In this case, it is caused by a change in functionality. The input
statement will not work for functions defined in challenges since there is no "user" present to provide input. The challenge checker will call the defined function with specific arguments and compare the returned value to the expected value.
Hint: replace the input
statement with two statements that attempt to convert the inputs "a" and "b" into float values (such as a = float(a)
) then change the return
statement to return the sum of these two converted values.
Kyle & Lainy Clemens-Arbues
2,640 PointsKyle & Lainy Clemens-Arbues
2,640 PointsThank you!!! It's all making more sense now :)