Welcome to the Treehouse Community
Looking to learn something new?
Tariq Kfaery956 Points
what is required to write at else?
You're doing great! Just one more task but it's a bigger one. Right now, we turn everything into a float. That's great so long as we're getting numbers or numbers as a string. We should handle cases where we get a non-number, though. Add a try block before where you turn your arguments into floats. Then add an except to catch the possible ValueError. Inside the except block, return None. If you're following the structure from the videos, add an else: for your final return of the added floats.
def add(X , Y): try: return float(X) + float(Y) except ValueError: return None else: return X + Y
Kevin Brennan19,920 Points
Your code as such is correct but because it is a function all your code inside the function should be indented . Just move everything in 4 spaces and it should pass.