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 trialNyasha Mujakachi
4,176 Pointsi am failing to pass through this one
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 passed in.
(A square is the value multiplied by itself. eg: The square of 5 is 25. 25 = 5 x 5)
def square(number):
value=5*5
return value
7 Answers
Brandon Oakes
Python Web Development Techdegree Student 11,501 PointsYou need to put number in the place where you have 5. The ultimate goal of the function is to take an argument(number) and times it by itself to get its square. Number just represents different possible numbers that could be placed in the function. Hope this helps.
def square(number): value=number * number return value
Antonio Falcetta
14,192 Pointsdef square(number):
return number * number
cosmas mwirigi
1,381 Pointstry this:
def square(number): answer = number * number return answer square(5) print(square)
ravi sankar
375 Pointsdef square(number): value=number**2 return(value) this would do it
Nyasha Mujakachi
4,176 Pointsthank you Oakes was off the treehouse for a while
Bruce Wayne
Full Stack JavaScript Techdegree Student 216 Pointsdef square(number): value = 5 result = number * number return result
Michelle Moreno
229 Pointsdef square(number): value=number * number return value
make sure to indent*
Martin Traykov
293 PointsMartin Traykov
293 PointsYep , i`m failing as well over and over again