Welcome to the Treehouse Community
Looking to learn something new?
I'm not sure what i'm doing wrong on this challenge.
I don't know if we were supposed to create an input to get the numbers? It doesn't say that we need to, but I can't get the correct answer here. If anyone can explain what i'm doing wrong, i'd appreciate it.
def add(one, two): try: one = float(one) two = float(two) except ValueError: return ("None.") else: return (one + two) ad = add(3,3) print(ad)
Steven Parker215,959 Points
You're really close! Here are a few hints:
- for the challenge, just define the function, don't call it yourself
- you also won't need to print anything
- None is a special Python keyword. Don't add a period or put quotes around it (that makes it an ordinary string).
- FYI: you don't need parentheses after a return (but they don't hurt anything)