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 trialChristian Vermette
1,025 PointsI need to return floats plz help
I need to return my 2 arguments as floats but i cant figure it out please help
def add(arg1, arg2):
return(float(arg1+arg2))
3 Answers
Jennifer Nordell
Treehouse TeacherHere's a hint: float can only ever take one argument. But there are many people that get stuck on this challenge. These forums are awesome and quite often already have answers to each challenge. Take a peek here https://teamtreehouse.com/community/python-code-challenge-problems
Colin Smith
32,063 PointsSo the idea is the float both numbers in the return. While it seems like a general float around arg1 + arg2 would work it is actually like this:
def add(arg1, arg2):
return(float(arg1) + float(arg2))
You need to float both arguments individually, not the return as a whole.
Damien Dale
Courses Plus Student 2,422 Pointshttps://teamtreehouse.com/community/question-not-understood-why-is-this-not-correct-see-code
Maybe this link will help.
Christian Vermette
1,025 PointsChristian Vermette
1,025 Pointsoh wow thanks and yeah i havent fully discovered how to maneuver myself in the forums yet but next time il try the forums before i ask ty so much for your help with my questions :D