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

i dont' know whatis probleme here

hi in challenge task 3 i don't know what'is probleme

trial.py
def add(a,b):
    return (float(a) + float(b))
        try:
        a = float(input("number")
        b = float(input("number")
        except ValueError:
          return None
        else:
           return
        add(a,b)
add(a,b)

2 Answers

Alex Diaz
Alex Diaz
4,930 Points

First of all, you don't need that "add (a. b)", the challenge will do that for you. Then you're going to need to remove that return statement right under the def add(a, b). Then under your try block, first make sure that it's indented. Then you're trying to see if float(a) + float(b) works. Your except block is correct. Now for your else block. It says if the try block works then to return float(a) + float(b) so you should do that. Then you're going to need to get rid of the "add (a, b)" again.

I'm new to python as well so if I'm not explaining things very clearly, my apologies!

oh!!!!!!, i know now what i do thanks you Alex