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! While you're at it, check out some resources Treehouse students have shared here.
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 trialDerick Ho
3,113 Pointshow do I convert values to float?
I tried to do
num1 = float(arg1) num2 = float(arg2) return num1 + num2
but it wouldn't work
def add(float arg1,float arg2):
return arg1 + arg2
1 Answer
Steven Parker
231,271 PointsWhen you say "it wouldn't work", had you already put the word "float" in with the arguments? That's not proper syntax.
Otherwise, it should work just fine.
Derick Ho
3,113 PointsDerick Ho
3,113 PointsI fixed it already. Thanks a lot though.
Steven Parker
231,271 PointsSteven Parker
231,271 PointsIf a question has not been answered, you can always delete it. If it has been answered adequately, you can mark it solved by choosing a "best answer", and if no answer is adequate you can edit the title and add "[SOLVED]".