Welcome to the Treehouse Community
Looking to learn something new?
Sean Frye1,167 Points
I'm really trying here! I can't get this down!
I'm really trying here! I don't ever recall using the float function before or especially even learning about it during any part of this course and all I can do is look up what the function float even is and after reading about it and even typing something in, I still can't do it! I hate feeling like I'm not up to the task!
def add(num1, num2): return(num1+num2) float(10)
Cameron Nilon15,601 Points
Don't beat your self up about it, it will come to you. So what your trying to achieve is convert the type. So let's say you pass two numbers but they are in the form of a string type an example would be ~ add("1", "2") you will need to convert these two sting types into number types, in your case they are to be of float type. I think I can best explain this in code so here is an example to drive this home for you.
def add(num1, num2) return float(num1) + float(num2) # some use examples # add("1", "2") this will return 3.0 # add(5, 10) returns 15.0
For some more info on this topic look into type casting. This is generally used accross all different programming languages.