Welcome to the Treehouse Community
Looking to learn something new?
how do i solve this?
i kinda hit a roadblock, i have triad every way i know to solve this? anyone know what im doing wrong??
def add(name, age): try: float(add) except ValueEror: return(None) else: return(float(name)+float(age))
Gianmarco Mazzoran22,076 Points
Just need to remove the parentesis when you
return things, and replace what's inside the
try block with the content of the
So your final code would look like this:
def add(name, age): try: return float(name) + float(age) # no parenthesis when you use 'return' except ValueError: return None
Remember the indentation when you write a block of code in python!