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 trialSwan The Human
Full Stack JavaScript Techdegree Student 19,338 Pointsi dont get how to do this.
i need help. i dont understand.
def square('number'):
return('number')
1 Answer
Viraj Deshaval
4,874 PointsHi Sean, In your function you are passing arguments as string 'number'. It should be a variable who refer to any integer or floating point number.
What this challenge is asking you to do is 1. create function called square with one parameter int/float value 2. Return the square of the result. So square of number can be performed as below:
a = 3
square = a * a
square
9
3. Refer the code above and create the function.
4. Then call the function by passing argument 3 and assign the returned value to result variable.
Swan The Human
Full Stack JavaScript Techdegree Student 19,338 PointsSwan The Human
Full Stack JavaScript Techdegree Student 19,338 PointsHey thanks man I appreciate the help! Makes more sense now
Viraj Deshaval
4,874 PointsViraj Deshaval
4,874 PointsHi Sean, Cheers. Mark as a best answer so that others can see and resolve their doubts quickly.