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 trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Gideon Tyree](https://secure.gravatar.com/avatar/370764845f1aa4dde6cff94db9fa47d1?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Gideon Tyree
1,329 Pointshow do you Create a function named square. It should define a single parameter named number.
def square(number):
1 Answer
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsYou're good so far, but that's only half of the instructions. The rest say "In the body of the function, return the square of the value that was passed in."
So now add your function body beneath the declaration line to complete the challenge.
MightyIronElf 14
1,660 PointsMightyIronElf 14
1,660 PointsBut how do I add the rest of the function body? After typing my answer: number = (5) def square(number): return number *5 It keeps telling me my math is wrong and I have no idea what is wrong.
Steven Parker
230,688 PointsSteven Parker
230,688 PointsA function body is created by adding one or more lines following the "def" line that are all indented. These lines should contain the code you want the function to perform. For the function to have a value the last line of the body should be a "return" statement.
You will also want the function to be able to work with any given number, so be sure not to use any constant values in the function code.
You might want to take another look at the code examples in the Functions and Returning Values videos.