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 trial925 prod
421 Pointscreate a function named square It should define a single parameter named number. In the body of the function, return..
...the square of the val that was passed in.
7 Answers
fodhil zidane
24,020 Pointsdef square(number): return number ** 2
Jack Kussmann
1,033 Pointsdef square(number): value = number * number return value
fodhil zidane
24,020 Pointsdef square(number): squaren = number * number return (squaren)
925 prod
421 PointsSorry this was the question.. I guess I posted it wrong.
Create a function named square. It should define a single parameter named number. In the body of the function, return the square of the value that was passed in. (A *square is the value multiplied by itself. eg: The square of 5 is 25. 25 = 5 x 5)*
This is my code: def suqare(number): value = number * number
diogorferreira
19,363 PointsIt might be just me but there is nothing in the question?
fodhil zidane
24,020 Pointsplease, which second line you are talking about?
Richard Thomas
3,029 Points0/10 task for teaching
Monamato Blessed Kgomari
229 Pointsdef square (number) return number **2
hamza nabulsi
166 Pointsany luck for this quiz yet?
925 prod
421 Points925 prod
421 PointsSo that did work, but why on this particular code was not second line needed.?