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!
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
Mariya Shklyar1,022 Points
Need help with quiz
What did I do worng in the second question of the quiz?
one = 1 two = 2 def add(one, two): float(1) float(2) return(one + two)
Julian Gutierrez19,201 Points
There is no need to declare the variables just include the float conversion in your return.
def add(num1, num2): return float(num1)+float(num2)
【code challenge 1/3】
def add(num1, num2): return(num1 + num2)
【code challenge 2/3】
def add(num1, num2): a = float(num1) b = float(num2) return(a + b)
【code challenge 3/3】
def add(num1, num2): try: a = float(num1) b = float(num2) except ValueError: return None else: return(a + b)