Welcome to the Treehouse Community
Looking to learn something new?
what is the correct syntax for try and except with two arguments that should return a float
Can someone take a look at my structure for this code challenge, I am not sure what is causing this challenge to fail.
def add(apple, orange): try: apple = int(input("please input a number")) orange = int(input("please input a number")) except ValueError: return None else: return float(apple) + float(orange)
Thanks I got it! I got messed up when I was trying to evaluate the arguments not the results. also to note that you do not need to declare a variable in the try block for the challenge to pass though it does make sense for dry purposes, the last expression in your block can be return final instead of repeating your expression.