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 trial

Python Python Basics (2015) Logic in Python Try and Except

Daniel Whiteman
seal-mask
.a{fill-rule:evenodd;}techdegree
Daniel Whiteman
Full Stack JavaScript Techdegree Student 19,248 Points

Keep getting the message that Task 1 is no longer passing.

I'm totally stuck at this point. I've tried a number of solutions for part 3/3 of this challenge but keep getting the message task 1 no longer passes. Ideas please!

trial.py
def add (arg1, arg2):
try:
    num = float(arg1) + float(arg2)
except ValueError:
    return None    
else:
    return num
Marzoog AlGhazwi
Marzoog AlGhazwi
15,796 Points
def add (arg1, arg2):
    try:
        num = float(arg1) + float(arg2)
    except ValueError:
        return None    
    else:
        return num

You forgot the indentations

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! When you get a "Task 1 is no longer passing" message, the most common reason for getting this a syntax error. At that point, none of your code can be compiled/interpreted. This is the case here. None of your code is indented inside the add function, rather it exists inline with it. All your code below def add needs to be indented one level.

Hope this helps! :sparkles: